Is there a way to modify an Android app's header programatically? Maybe even adding a custom view with an image in it? I'm talking about the gray bar at the top of an app, whose text can be modified via an开发者_高级运维 app's Mainfest.xml with the label attribute of the activity:
<activity android:name=".ProgramTracks" android:label="@string/app_name">
</activity>
Is there some way to, for a lack of a better word, mess with that?
Already discussed here.
You can add a custom header inside your activitys onCreate(). Write an usual xml layout and call
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
where R.layout.window_title is your custom layout.
精彩评论