2014-02-27 28 views
1

我在values/styles.xml中有這個主題,我將其應用於我的整個應用程序。文本選擇句柄似乎沒有改變

<!-- Base application theme. --> 
<style name="AppTheme" parent="@style/_AppTheme"> 
    <!-- a bunch of things... --> 
    <item name="android:textColorHighlight">#9999cc00</item> 
    <!-- a bunch of things... --> 
</style> 

<style name="_AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"/> 

然後在值-V9

<?xml version="1.0" encoding="utf-8"?> 
<resources xmlns:android="http://schemas.android.com/apk/res/android"> 
    <style name="AppTheme" parent="@style/_AppTheme"> 
     <item name="android:textSelectHandleLeft">@drawable/apptheme_text_select_handle_left</item> 
     <item name="android:textSelectHandleRight">@drawable/apptheme_text_select_handle_right</item> 
     <item name="android:textSelectHandle">@drawable/apptheme_text_select_handle_middle</item> 
    </style> 
</resources> 

最後的值-V11

<?xml version="1.0" encoding="utf-8"?> 
<!-- Generated with http://android-holo-colors.com --> 
<resources xmlns:android="http://schemas.android.com/apk/res/android"> 
    <style name="AppTheme" parent="@style/_AppTheme"> 
     <item name="android:dropDownSpinnerStyle">@style/SpinnerAppTheme</item> 
     <item name="android:listChoiceBackgroundIndicator">@drawable/apptheme_list_selector_holo_light</item> 
     <item name="android:activatedBackgroundIndicator">@drawable/apptheme_activated_background_holo_light</item> 

     <item name="android:textColorHighlight">#9999cc00</item> 
     <item name="android:textSelectHandleLeft">@drawable/apptheme_text_select_handle_left</item> 
     <item name="android:textSelectHandleRight">@drawable/apptheme_text_select_handle_right</item> 
     <item name="android:textSelectHandle">@drawable/apptheme_text_select_handle_middle</item> 
    </style> 
</resources> 

所有可繪製的是在各自的文件夾中。 這對更改應用程序任何部分中的文本選擇句柄沒有影響。

這是因爲AppCompat庫的使用可能嗎?

我該如何修復?

+1

這是對的HTC Sense?我也有同樣的問題。 –

+0

同樣在華爲! – SadeepDarshana

+0

@doplumi你有沒有想出一個解決方案? – SadeepDarshana

回答

1

使用這個鏈接

http://android-holo-colors.com/

這裏最糟糕的部分是找到了「名」這個項目以及它是如何被稱爲主題內。於是我瀏覽了android SDK文件夾中的每個drawable,最後找到名爲「text_select_handle_middle」,「text_select_handle_left」和「text_select_handle_right」的drawable。

因此,解決辦法很簡單:這些繪圖資源與定製設計/顏色添加到您的繪製文件夾,然後將它們添加到您的主題風格的定義,如:

<style name="MyCustomTheme" parent="@style/MyNotSoCustomTheme"> 
     <item name="android:textSelectHandle">@drawable/text_select_handle_middle</item> 
     <item name="android:textSelectHandleLeft">@drawable/text_select_handle_left</item> 
     <item name="android:textSelectHandleRight">@drawable/text_select_handle_right</item> 
</style> 
+3

是啊...你真的讀過我的問題嗎? – doplumi

相關問題