Custom "actionBarTabStyle" does not override AppCombat theme

I’m trying now for hours to override the AppCombat theme for custom tab style, but my changes have no effect. Here is my style.xml

<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
    <item name="actionBarTabStyle">@style/MyActionBarTabs.AppTheme</item>
</style>

<!-- ActionBar tabs styles -->
<style name="MyActionBarTabs.AppTheme" parent="@style/Widget.AppCompat.ActionBar.TabView">

    <item name="background">@drawable/tab_bar_background</item>
</style>

I use android-support-libray-v7 for use ActionBarTabStylein older versions of Android. This is tab_bar_background.xml

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false"
      android:state_pressed="false"
      android:drawable="@color/boni_red" />
<item android:state_focused="false" android:state_selected="true"
      android:state_pressed="false"
      android:drawable="@color/boni_red" />

<!-- Focused states (such as when focused with a d-pad or mouse hover) -->
<item android:state_focused="true" android:state_selected="false"
      android:state_pressed="false"
      android:drawable="@color/boni_red" />
<item android:state_focused="true" android:state_selected="true"
      android:state_pressed="false"
      android:drawable="@color/boni_red" />
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false"
      android:state_pressed="true"
      android:drawable="@color/boni_red" />
<item android:state_focused="false" android:state_selected="true"
    android:state_pressed="true"
    android:drawable="@color/boni_red" />

<!-- Focused states (such as when focused with a d-pad or mouse hover) -->
<item android:state_focused="true" android:state_selected="false"
      android:state_pressed="true"
      android:drawable="@color/boni_red" />
<item android:state_focused="true" android:state_selected="true"
      android:state_pressed="true"
      android:drawable="@color/boni_red" />

In the class, TabActivityI just add some tabs using TabHost, and the layout for this action is as follows:

<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:id="@+id/TabBarLinearLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <TextView 
        android:id="@+id/header_logo"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:background="@color/boni_red"
        android:text="@string/app_name_capital"
        android:textStyle="bold"
        android:gravity="center"
        android:textSize="25sp"/>

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

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0">
    </TabWidget>


</LinearLayout>

I just followed the tutorial presented by the Android developers page . The tablet in my application looks like light in the picture. Tabbar

, ? ! - ? ,

+3
1

: values-v11 ( 'android:)

<style name="AppTheme" parent="@style/Theme.AppCompat.Light">
<item name="android:actionBarTabStyle">@style/MyActionBarTabs.AppTheme</item>

styles.xml( 'android:)

<item name="android:background">@drawable/tab_bar_background</item>

`

0

All Articles