Android 如何编辑标题栏?
我需要让我的标题栏变成橙色而不是标准的灰色,我不知道如何编辑它的设置。我还需要对齐文本,使其位于标题栏的右侧,而不是左侧。关于如何实现这一点有什么想法吗?要为标题栏提供所需的颜色(橙色),请在oncreate中使用以下代码Android 如何编辑标题栏?,android,text,alignment,titlebar,android-titlebar,Android,Text,Alignment,Titlebar,Android Titlebar,我需要让我的标题栏变成橙色而不是标准的灰色,我不知道如何编辑它的设置。我还需要对齐文本,使其位于标题栏的右侧,而不是左侧。关于如何实现这一点有什么想法吗?要为标题栏提供所需的颜色(橙色),请在oncreate中使用以下代码 this.setTitleColor(#FF6600); 或者创建自定义标题栏并在整个应用程序中使用它。如果您创建自定义标题栏,您可以进行各种修改 例如 <?xml version="1.0" encoding="utf-8"?>
this.setTitleColor(#FF6600);
或者创建自定义标题栏并在整个应用程序中使用它。如果您创建自定义标题栏,您可以进行各种修改
例如
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="400px"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView android:id="@+id/ImageView01"
android:layout_width="57px"
android:layout_height="wrap_content"
android:background="@drawable/icon1">
</ImageView>
<TextView
android:id="@+id/myTitle"
android:text="This is my new title"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textColor="@color/titletextcolor"
/>
</LinearLayout>