Od wielu dni próbuję zastąpić motyw Holo dla niestandardowego stylu kart, ale moje zmiany nie mają żadnego efektu.Dlaczego mój niestandardowy "actionBarTabStyle" nie zastępuje domyślnego stylu/motywu?
Oto mój styles.xml
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme" parent="@android:style/Theme.Holo">
<item name="android:tabWidgetStyle">@style/MyActionBarTabs</item>
</style>
<!-- ActionBar tabs styles -->
<style name="MyActionBarTabs" parent="@android:style/Widget.Holo.ActionBar.TabView">
<!-- tab indicator -->
<item name="android:background">@drawable/tabselector</item>
</style>>
To mój tabselector.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:drawable="@drawable/tab_unselected_holo" android:state_focused="false" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/tab_selected_holo" android:state_focused="false" android:state_pressed="false" android:state_selected="true"/>
<!-- Focused states -->
<item android:drawable="@drawable/tab_unselected_focused_holo" android:state_focused="true" android:state_pressed="false" android:state_selected="false"/>
<item android:drawable="@drawable/tab_selected_focused_holo" android:state_focused="true" android:state_pressed="false" android:state_selected="true"/>
<!-- Pressed -->
<!-- Non focused states -->
<item android:drawable="@drawable/tab_unselected_pressed_holo" android:state_focused="false" android:state_pressed="true" android:state_selected="false"/>
<item android:drawable="@drawable/tab_selected_pressed_holo" android:state_focused="false" android:state_pressed="true" android:state_selected="true"/>
<!-- Focused states -->
<item android:drawable="@drawable/tab_unselected_pressed_holo" android:state_focused="true" android:state_pressed="true" android:state_selected="false"/>
<item android:drawable="@drawable/tab_selected_pressed_holo" android:state_focused="true" android:state_pressed="true" android:state_selected="true"/>
</selector>
Dodałem zaczepy pomocą TabHost w mojej działalności, a jej układ wygląda tak
<android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="horizontal" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
Podążyłem za przykładami z Android Developer Page
Moje zakładki nadal wyglądają tak samo. Wskaźniki mojej karty mają być moim niestandardowym kolorem różu. Jednak nie ma zmian, są nadal niebieskie.
warte Uwaga:
- Mój plik manifestu odwołuje zaktualizowany motyw w moich tagów aplikacji
- Moja styles.xml jest aktualizowana w każdym folderze wartości (wartości, wartości-v11, wartości-v14)
- Wszystko to nie było dodać pasek działań na szczycie mojego wniosku z moim ic_launcher obraz i tytuł
Co mi brakuje albo robi źle? Doceniam każdą pomoc. Dziękuję wam wszystkim!
Dzięki za szybką odpowiedź. Zrobił to. To zdecydowanie zmieniło coś z linią włosów pod zakładkami ... Jednak niebieski kolor wskaźnika nadal tam jest. Myślę, że widzę różowy ukryty pod niebieskim ... ale nadal się nakłada. –
Zaktualizowałem swój kod w pliku style.xml, aby wyświetlić edycję w Twojej sugestii –
@MarkBarrasso Zrobiłem edycję z pełnym przykładem. – adneal