AutoCompleteTextView用法总结
来源:互联网 发布:工控编程吧网址 编辑:程序博客网 时间:2024/05/24 05:58
1.AutoCompleteTextView
设置下拉列表的背景样式,可以设置AutoCompleteTextView.setDropDownBackgroundDrawable()
2.android:textCursorDrawable = "@null"
EditText有一个属性:android:textCursorDrawable,这个属性是用来控制光标颜色的
android:textCursorDrawable="@null","@null"作用是让光标颜色和text color一样
关于AutoCompleteTextView设置背景无效的解决办法
最后解决办法是,不要调用setDropDownBackgroundDrawable这个方法,而是直接改成在布局
文件里设置android:popupBackground属性(这个属性用“Alt+/”是不会有提示的。需手动加上)。
有的机型需要代码和布局同时设置。
如何去掉AutoCompleteTextView的滚动条
首先,在styles.xml中定义一个样式,其继承自ListView.DropDown,其中的两个item分别指定了滚动条隐藏和分割线。dropdown_divider是我定义的一个shape,这个很简单,自行定义接着,我们创建一个主题,在这个主题中设置dropDownListViewStyle属性的值为我们刚才定义的风格样式。这个属性用于控制DropdownList的样式的,通过设置这个属性,从而实现控制DropdownList最后,我们只要把这个主题应用到我们用了AutoCompleteTextView的Activity中就可以了。这里我在Android Mainifest.xml中指定通过以上设置,实现了AutoCompleteTextView下拉框隐藏滚动条,这也只是抛砖引玉,大家还可以通过样式控制下拉框的很多属性。具体的大家可以去看看ListView.DropDown以及其父样式中都定义了什么属性。
0 0
- AutoCompleteTextView用法总结【Android】
- AutoCompleteTextView用法总结
- AutoCompleteTextView 用法
- AutoCompleteTextView用法
- autoCompleteTextView用法简析
- AutoCompleteTextView的用法
- android--AutoCompleteTextView用法
- AutoCompleteTextView 简单用法
- AutoCompleteTextView 简单用法
- AutoCompleteTextView最基础用法
- AutoCompleteTextView 简单用法
- Android基础-AutoCompleteTextView用法
- AutoCompleteTextView的用法
- AutoCompleteTextView 简单用法
- Android搜索-AutoCompleteTextView的用法
- AutoCompleteTextView监听器的一些用法
- AutoCompleteTextView用法和实例1
- AutoCompleteTextView和Spinner的用法
- Tomcat 系统架构与设计模式,第 2 部分: 设计模式分析
- HashPasswordForStoringInConfigFile 已过时
- intellij 15 搭建破解 继承jrebel for mac
- Stream语法详解
- Qt学习笔记:小技巧
- AutoCompleteTextView用法总结
- Sublime Text 3 搭建C++开发环境与插件
- Android ServiceConnection
- JS错误
- 【2016百度之星资格赛】吐槽
- EventBus使用详解(一)——初步使用EventBus
- 算法时间复杂度计算
- android studio2.1创建项目的两个坑
- 怎么把String类型转化成Integer类型???