如何为我的android应用程序定制标题栏?
可能重复:如何为我的android应用程序定制标题栏?,android,Android,可能重复: 我想为我的应用程序创建自定义标题栏,以显示我的应用程序名称的颜色。我如何才能做到这一点?在活动中写下这一点 getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle); mytitle布局是xml文件,它将显示为标题菜单。 下面是一个小例子 <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http
我想为我的应用程序创建自定义标题栏,以显示我的应用程序名称的颜色。我如何才能做到这一点?在活动中写下这一点
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.mytitle);
mytitle布局是xml文件,它将显示为标题菜单。
下面是一个小例子
<?xml version="1.0" encoding="utf-8"?>
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myTitle"
android:text="custom title bar"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="@color/titletextcolor"
android:gravity ="center"/>
你可以自己做。其他参考。这是创建自定义标题栏的最佳示例。。。
setTitle("Your TITLE");