Android中EditText和AutoCompleteTextView設置文字選中顏色方法
EditText和AutoCompleteTextView設置文字選中顏色 大多數(shù)Android Rom上,文本選擇的背景色都是很好看的鮮綠色, 但是在某些垃圾的三星手機上,居然是藍色,令人惡心反感,其實完全可以通過程序來修改,文本的默認選中背景色.
所用API解釋
android:textColorHighlight Color of the text selection highlight.
EditText設置效果

AutoCompleteTextView 設置效果

實現(xiàn)代碼
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/et_inputBox"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:textColorHighlight="#B4DF87"
/>
<AutoCompleteTextView
android:id="@+id/act_input"
android:layout_below="@id/et_inputBox"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColorHighlight="#B4DF87"
/>
</LinearLayout>
相關文章
深入解析Android系統(tǒng)中應用程序前后臺切換的實現(xiàn)要點
這篇文章主要介紹了Android系統(tǒng)中應用程序前后臺切換的實現(xiàn)要點,除了切換操作的效果之外還重點講解了判斷程序運行于前臺還是后臺的方法,需要的朋友可以參考下2016-04-04
Android掃描二維碼時出現(xiàn)用戶禁止權限報錯問題解決辦法
這篇文章主要介紹了Android掃描二維碼時出現(xiàn)用戶禁止權限報錯問題解決辦法的相關資料,需要的朋友可以參考下2017-06-06
Android監(jiān)聽鍵盤狀態(tài)獲取鍵盤高度的實現(xiàn)方法
這篇文章主要給大家介紹了關于Android監(jiān)聽鍵盤狀態(tài)獲取鍵盤高度的實現(xiàn)方法,文中通過示例代碼介紹的非常詳細,對各位Android開發(fā)者們具有一定的參考學習價值,需要的朋友們下面來一起學習學習吧2019-12-12
Android DSelectorBryant 單選滾動選擇器的實例代碼
本文通過實例代碼給大家介紹了Android DSelectorBryant 單選滾動選擇器的相關知識,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2019-10-10

