2011-02-10 116 views
0

我需要让我的标题栏变为橙色而不是标准灰色,而且我无法弄清楚如何编辑它的设置。我还需要对齐文本,使其位于标题栏的右侧而不是左侧。任何想法如何做到这一点?如何编辑标题栏?

回答

0

为了让标题栏您想要的颜色(橙色),使用下面的代码在你的OnCreate,

this.setTitleColor(#FF6600); 

或创建自定义标题栏,并用它在整个应用程序。如果您创建自定义标题栏,U可以进行各种修改。

例如。

 <?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>