手机
当前位置:查字典教程网 >编程开发 >安卓软件开发 >Android中EditText和AutoCompleteTextView设置文字选中颜色方法
Android中EditText和AutoCompleteTextView设置文字选中颜色方法
摘要:EditText和AutoCompleteTextView设置文字选中颜色大多数AndroidRom上,文本选择的背景色都是很好看的鲜绿色,...

EditText和AutoCompleteTextView设置文字选中颜色 大多数Android Rom上,文本选择的背景色都是很好看的鲜绿色, 但是在某些垃圾的三星手机上,居然是蓝色,令人恶心反感,其实完全可以通过程序来修改,文本的默认选中背景色.

所用API解释

复制代码 代码如下:

android:textColorHighlight Color of the text selection highlight.

EditText设置效果

Android中EditText和AutoCompleteTextView设置文字选中颜色方法1

AutoCompleteTextView 设置效果

Android中EditText和AutoCompleteTextView设置文字选中颜色方法2

实现代码

复制代码 代码如下:

<"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中EditText和AutoCompleteTextView设置文字选中颜色方法】相关文章:

android中ListView多次刷新重复执行getView的解决方法

Android开发笔记 改变字体颜色的三种方法

android 对话框弹出位置和透明度的设置具体实现方法

Android中使用sax解析xml文件的方法

Android中实现EditText圆角的方法

在android中ScrollView嵌套ScrollView解决方案

Android HttpClient GET或者POST请求基本使用方法

android ListView自动滚动方法

基于Android中的 AutoCompleteTextView实现自动填充

Android RadioButton单选框的使用方法

精品推荐
分类导航