問題描述
所以我用 Holo Colors Generator 和 Action Bar Style Generator 到我自己的顏色.但是當我在編輯文本中選擇文本時,所選位置的標記"仍然是藍色的.怎么改?
So I changed the style of the Holo Theme with the Holo Colors Generator and Action Bar Style Generator to my own color. But when I select text inside an edit text, the "markers" at the selected positions are still blue. How can I change it?
推薦答案
這里最糟糕的部分是找到該項目的名稱"以及如何在主題中調用它.所以我查看了android SDK文件夾中的每個drawable,最后找到了名為text_select_handle_middle"、text_select_handle_left"和text_select_handle_right"的drawable.
The worst part here was to find the "name" for this item and how it is called inside the theme. So I looked through every drawable in the android SDK folder and finally found the drawables named "text_select_handle_middle", "text_select_handle_left" and "text_select_handle_right".
因此解決方案很簡單:將這些具有自定義設計/顏??色的可繪制對象添加到您的可繪制文件夾中,并將它們添加到您的主題樣式定義中,例如:
So the solution is simple: Add these drawables with customized design/color to your drawable folder and add them to your theme style definition like:
<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>
這篇關于如何更改 EditText 選擇句柄/錨點的顏色/外觀?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!