开发者

Android How to change the application title

开发者 https://www.devze.com 2023-01-21 15:48 出处:网络
HI I need to change the application title as when i move to new tab. i tried to change the app_name with varying string in string.xml but that is not actual dynamic change that i want.

HI I need to change the application title as when i move to new tab.

i tried to change the app_name with varying string in string.xml but that is not actual dynamic change that i want.

is there any alternative way of doi开发者_运维技巧ng this?


You can simply call the setTitle() function from within your Activity. It takes either an int (resource ID) or a CharSequence as a parameter.


android:label in AndroidManifest.xml is using reference to @string/app_name for user readable application name (app name in applications list or name under icon on main screen if you add shoutcut)

For changing Activity title you should use setTitle() of Activity class.


then you have to set the custom title for your app. check my post.

You have to set a custom layout for your title. you can access the TextView object from that.

Edit:

Accept Apologize. i didnt read the question propely.

setTitle() method is enough. My answer is about to customizing the title.that is color, text size and all.

0

精彩评论

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