You can set a number of general window properties, such as whether to display a title, whether the window is floating, and whether it displays an icon, by calling methods on the Window member of the underlying View object for the window. Examples include calling getWindow().requestFeature() (or the convenience method requestWindowFeature(some_feature)) to hide the title. Here is an example of hiding the title bar:
//Hide the title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
A better way to achieve the same end is to specify a theme in your Android Manifest file:
<application android:icon="@drawable/icon" android:theme="@android:style/Theme.NoTitleBar">
This is preferable because it tells the system not to show a title bar while your application is starting up. With the explicit method call, your application will have a title bar visible to the user until onCreate runs.
(Note that this can be applied to either the <application> tag or to individual <activity> tags.)
From. Android Developers
댓글 없음:
댓글 쓰기