改变标题栏内容的方式常用的有2种,一种是静态的,在AndroidMainFest.xml中指定:
加入:
android:label="@string/aboutTitle"
如:
<activity android:name="cn.com.smartcost.offer.ui.AboutActivity"
android:parentActivityName="cn.com.smartcost.offer.ui.ListViewActivity"
android:label="@string/aboutTitle"
>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="cn.com.smartcost.offer.ui.ListViewActivity"
/>
</activity>
另一种是动态的,在activity中设定:
getActionBar().setTitle(mDrawerTitle);
本文介绍了两种在Android应用中设置标题栏的方法:一是在AndroidManifest.xml文件中静态设定;二是在Activity中动态设定。静态设定适用于固定不变的标题,而动态设定则允许开发者在运行时更改标题。
4万+

被折叠的 条评论
为什么被折叠?



