自定义选项卡样式(xml)在Android选项卡中不起作用(Appcelerator)

自定义选项卡样式(xml)在Android选项卡中不起作用(Appcelerator),android,titanium,appcelerator,titanium-mobile,appcelerator-mobile,Android,Titanium,Appcelerator,Titanium Mobile,Appcelerator Mobile,我想更改Android选项卡的默认背景色。我正在使用Appcelerator框架创建应用程序。但是更改选项卡样式仍然需要创建xml文件。所以本地安卓开发者也可以帮助我 无论如何,我创建了以下xml代码: <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabh

我想更改Android选项卡的默认背景色。我正在使用Appcelerator框架创建应用程序。但是更改选项卡样式仍然需要创建xml文件。所以本地安卓开发者也可以帮助我

无论如何,我创建了以下xml代码:

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="0dp"
        android:background="@drawable/tab_selector" >

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="0dp"
            android:layout_weight="1" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0" />
    </LinearLayout>
</TabHost>
但当我运行我的应用程序时,我仍然需要使用旧的原始标签样式。知道为什么我的标签样式没有被应用吗???

嘿,你可以试试 我认为这对你很有用, 干杯

<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true">
        <shape> 
            <gradient 
                android:endColor="#ffffff" 
                android:startColor="#AAAAAA" 
                android:angle="270" /> 
            <stroke 
                android:width="1px" 
                android:color="#000000" /> 
        </shape>
    </item>

    <item
        android:state_selected="false" 
        android:state_focused="false" 
        android:state_pressed="false">
        <shape> 
            <gradient 
                android:endColor="#ffffff" 
                android:startColor="#AAAAAA" 
                android:angle="270" /> 
            <stroke 
                android:width="1px" 
                android:color="#000000" /> 
        </shape>
    </item>

    <!-- and the other states. They are the same as the ones above -->
    ...
    ...
    ...

</selector>