The default title bar for Android UI is defined by Android:label, which appears in the upper-left corner of the screen, Android allows activity to customize the title bar, and uses custom layout to reset the title bar, such as implementing the Windows Mobile style title bar.
App->activity->custom title re-defined Activity title bar as left and right two text boxes, class customtitle, its layout definition r.layout.custom_title_1 as follows, As a left-right two text box:
<!--Demonstrates how to use a custom title. See corresponding Java code Com.example.android.apis.app.CustomTitle.java. --><relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" android:id= "@+id/screen"Android:layout_width= "Match_parent" android:layout_height= "Match_parent"android:orientation= "vertical" > <textview android:id= "@+id/left_text"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentleft= "true"Android:text= "@string/custom_title_left"/> <textview android:id= "@+id/right_text"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_alignparentright= "true"Android:text= "@string/custom_title_right"/></relativelayout>
For each activity, in addition to using the content view set by Setcontentview, there is a Windows class object that controls the title bar, allows you to customize the title bar, or does not display the title bar.
Windows defines some FEATURE that allow developers to customize: The custom title bar corresponds to the FEATURE ID of Window.feature_custom_title.
requestwindowfeature (window.feature_custom_title); Setcontentview (r.layout.custom_title); GetWindow (). Setfeatureint (Window.feature_custom_title, r.layout.custom_title_1);
The view in R.layout.custom_title_1 can be obtained directly from the Findviewbyid.
"Sail Plan 006" 2015 sail plan Android apidemo Devil Pace app->activity->custom Title custom title bar