커스텀 탭 스타일의 Holo 테마를 덮어 쓰려고 며칠이나 노력했지만, 변경 사항이 적용되지 않습니다.내 'actionBarTabStyle'사용자 정의가 기본 스타일/테마를 덮어 쓰지 않는 이유는 무엇입니까?
다음은이
<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>
내가 내 활동에 TabHost를 사용하여 탭을 추가 한 내 tabselector.xml 내 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>>
그리고 레이아웃이
<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>
처럼 보인다
나는이 예제를 따르고있다. Android Developer Page
내 탭은 여전히 동일하게 보입니다. 내 탭 표시기가 내 사용자 정의 색 분홍색으로되어 있습니다. 그러나 변화가 없으며 여전히 푸른 색입니다.
유의할 것들 :
- 내 매니페스트 파일 내 응용 프로그램 태그에 업데이트 된 테마를 참조 내 styles.xml은 각 값 폴더에 업데이트됩니다
- (값, 값-V11, 값-V14) 이 모든 짓을
- 내 ic_launcher 이미지와 제목 I가 없거나 잘못을하고있는 중이 야 무엇
내 응용 프로그램의 상단에 작업 표시 줄을 추가했다? 어떤 도움을 주시면 감사하겠습니다. 다들 감사 해요!
감사 결과. 그거 했어. 탭 밑의 헤어 라인을 사용하여 확실히 뭔가를 바 꾸었습니다 ... 그러나 파란색 표시기 색상이 그대로 남아 있습니다. 나는 파란색 밑에 핑크색의 은신처가 보일 수 있다고 생각하지만 ... 여전히 겹쳐져있다. –
내 코드를 style.xml에 업데이트하여 제안 사항을 편집하십시오. –
@MarkBarrasso 전체 예제로 편집했습니다. – adneal