Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何编辑标题栏?_Android_Text_Alignment_Titlebar_Android Titlebar - Fatal编程技术网

Android 如何编辑标题栏?

Android 如何编辑标题栏?,android,text,alignment,titlebar,android-titlebar,Android,Text,Alignment,Titlebar,Android Titlebar,我需要让我的标题栏变成橙色而不是标准的灰色,我不知道如何编辑它的设置。我还需要对齐文本,使其位于标题栏的右侧,而不是左侧。关于如何实现这一点有什么想法吗?要为标题栏提供所需的颜色(橙色),请在oncreate中使用以下代码 this.setTitleColor(#FF6600); 或者创建自定义标题栏并在整个应用程序中使用它。如果您创建自定义标题栏,您可以进行各种修改 例如 <?xml version="1.0" encoding="utf-8"?>

我需要让我的标题栏变成橙色而不是标准的灰色,我不知道如何编辑它的设置。我还需要对齐文本,使其位于标题栏的右侧,而不是左侧。关于如何实现这一点有什么想法吗?

要为标题栏提供所需的颜色(橙色),请在oncreate中使用以下代码

   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>