源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-12-26 22:34 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Android中EditText和AutoCompleteTextView设置文字选中颜色方法
EditText和AutoCompleteTextView设置文字选中颜色 大多数Android Rom上,文本选择的背景色都是很好看的鲜绿色, 但是在某些垃圾的三星手机上,居然是蓝色,令人恶心反感,其实完全可以通过程序来修改,文本的默认选中背景色. 所用API解释
[u]复制代码[/u] 代码如下:
android:textColorHighlight Color of the text selection highlight.
[b]EditText设置效果[/b] [img]http://files.jb51.net/file_images/article/201501/201511794905573.png?201501794936[/img] [b]AutoCompleteTextView 设置效果[/b] [img]http://files.jb51.net/file_images/article/201501/201511794945092.png?201501794955[/img] [b]实现代码[/b]
[u]复制代码[/u] 代码如下:
<?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>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部