开发者

Android "Header" Text

开发者 https://www.devze.com 2023-03-16 02:16 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号