2010-05-10 89 views
0

我一直在使用API​​級別4,並且正在移動到級別5.我的活動中有一個選項卡小部件。這些標籤曾經是非常淺灰色的。移至API級別5後,它們非常黑暗。未選定的標籤幾乎是黑色的!我嘗試將主題設置爲淺色,但顏色仍然很暗。這是什麼原因?API級別5上的選項卡非常暗,但是API級別4更低?

+0

你能發佈一些代碼? – RoflcoptrException 2010-05-10 16:04:33

回答

2

對於您下載的所有SDK級別,可以在SDK res文件夾下找到選項卡的圖像。所以你可以打開它們並進行比較。如果目標是保持應用程序的外觀,我會選擇製表符。

編輯:您可以修改和使用該繪製

<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="@drawable/tab_unselected" /> 
    <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_selected" /> 

    <!-- Focused states --> 
    <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_focus" /> 
    <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/tab_focus" /> 

    <!-- Pressed --> 
    <item android:state_pressed="true" android:drawable="@drawable/tab_press" /> 
</selector> 
+0

好的,我們不能在1.5上設置標籤,對吧? – user246114 2010-05-10 16:10:24