开发者

Android "Header" Text

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜