【问题标题】:How do you edit title bar? [duplicate]如何编辑标题栏? [复制]
【发布时间】:2011-06-25 02:08:31
【问题描述】:

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

【问题讨论】:

    标签: android text alignment titlebar android-titlebar


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      要为标题栏提供所需的颜色(橙色),请在 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>
      

      【讨论】:

        猜你喜欢
        • 2023-02-05
        • 1970-01-01
        • 2011-10-27
        • 2021-10-27
        • 1970-01-01
        • 2011-01-24
        • 1970-01-01
        • 2014-11-18
        • 2018-05-27
        相关资源
        最近更新 更多