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

AutoCompleteTextView 設(shè)置效果

實(shí)現(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>
相關(guān)文章
深入解析Android系統(tǒng)中應(yīng)用程序前后臺(tái)切換的實(shí)現(xiàn)要點(diǎn)
這篇文章主要介紹了Android系統(tǒng)中應(yīng)用程序前后臺(tái)切換的實(shí)現(xiàn)要點(diǎn),除了切換操作的效果之外還重點(diǎn)講解了判斷程序運(yùn)行于前臺(tái)還是后臺(tái)的方法,需要的朋友可以參考下2016-04-04
Android掃描二維碼時(shí)出現(xiàn)用戶禁止權(quán)限報(bào)錯(cuò)問題解決辦法
這篇文章主要介紹了Android掃描二維碼時(shí)出現(xiàn)用戶禁止權(quán)限報(bào)錯(cuò)問題解決辦法的相關(guān)資料,需要的朋友可以參考下2017-06-06
Android 軟鍵盤彈出時(shí)把原來布局頂上去的解決方法
本文主要介紹了Android軟鍵盤彈出時(shí)把原來布局頂上去的解決方法。具有一定的參考作用,下面跟著小編一起來看下吧2017-01-01
Android利用Dom對(duì)XML進(jìn)行增刪改查操作詳解
使用DOM進(jìn)行增刪改查,這個(gè)是DOM的優(yōu)勢(shì)所在,其實(shí)代碼很簡單,不需要過多的解釋,下面這篇文章主要給大家介紹了關(guān)于Android利用Dom對(duì)XML進(jìn)行增刪改查操作的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),需要的朋友可以參考下。2018-01-01
Android監(jiān)聽鍵盤狀態(tài)獲取鍵盤高度的實(shí)現(xiàn)方法
這篇文章主要給大家介紹了關(guān)于Android監(jiān)聽鍵盤狀態(tài)獲取鍵盤高度的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對(duì)各位Android開發(fā)者們具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12
Android DSelectorBryant 單選滾動(dòng)選擇器的實(shí)例代碼
本文通過實(shí)例代碼給大家介紹了Android DSelectorBryant 單選滾動(dòng)選擇器的相關(guān)知識(shí),非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-10-10

