修改Android EditText光标颜色和底线颜色
1.修改光标颜色
EditText有一个属性:android:textCursorDrawable,这个属性是用来控制光标颜色的android:textCursorDrawable="@null","@null"作用是让光标颜色和text color一样
自定义样式:
<1>在资源文件drawable下新建一个光标控制color_cursor.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<size android:width="1dp"/>
<solid android:color="#f00"/>
</shape>
<2>设置EditText:android:textCursorDrawable="@drawable/color_cursor"
2.修改底线颜色:
<1>自定义样式:在资源文件drawable下新建一个光标控制backgroup_cursor.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item>
<shape android:shape="rectangle" >
<gradient
android:endColor="#ff7200"
android:startColor="#ff7200" />
</shape>
</item>
<item android:bottom="2dp">
<shape android:shape="rectangle" >
<gradient
android:endColor="#ffffff"
android:startColor="#ffffff" />
</shape>
</item> </layer-list>
<2>设置EditText属性:android:background="@drawable/backgroup_cusor"
修改Android EditText光标颜色和底线颜色的更多相关文章
- 修改Android EditText光标颜色
EditText有一个属性:android:textCursorDrawable,这个属性是用来控制光标颜色的 android:textCursorDrawable="@null&quo ...
- 华为手机Edittext光标(cursor)颜色修改
华为手机的emui系统经常让人发出“可以可以,这很华为”的感叹 这两天在edittext部分也发生了这样的事情 正常edittext光标的颜色和宽度都说可以修改的,只需要通过xml中的 textCur ...
- Android EditText光标颜色 与inputType
1.EditText有一个属性:android:textCursorDrawable,这个属性是用来控制光标颜色的 android:textCursorDrawable="@null&q ...
- android EditText光标位置(定位到最后)
方法:edittext.setSelection(int); et.setText(content);//设置EditText控件的内容et.setSelection(content.length() ...
- Android EditText默认不弹出输入法,以及获取光标,修改输入法Enter键的方法
一.Android EditText默认不弹出输入法的办法:1. 在AndroidManifest.xml中将需要默认隐藏键盘的Activity中添加属性即可(常用此方法) android:windo ...
- edittext 底线颜色
<style name="Custom.Widget.EditView" parent="Widget.AppCompat.EditText" > ...
- eros 修改 android上原生picker的颜色的呢
修改选中颜色和文字颜色 修改文件如下 修改窗口底色
- android EditText设置光标、边框和图标
控制边框形状,先在drawable中建一个xml文件:shape.xml <?xml version="1.0" encoding="utf-8"?> ...
- android EditText设置光标、边框和图标,以及限制输入
控制边框形状,先在drawable中建一个xml文件:shape.xml <?xml version="1.0" encoding="utf-8"?> ...
随机推荐
- UDS报文解读
UDS(Unified Diagnostic Services,统一的诊断服务)诊断协议是ISO 15765 和ISO 14229 定义的一种汽车通用诊断协议,位于OSI模型中的应用层,它可在不同的汽 ...
- 关于C语言打印string类字符串的问题
首先因为printf函数输出字符串是针对char *的,即printf只能输出c语言的内置数据,而string不是c语言的内置数据. 其次string类型的对象不止包含字符串,还包含了许多用于操作的函 ...
- 安装及创建python虚拟环境
有点气,是真的有点气,以为安装错误了,没想到是命令问题 参考链接: https://cloud.tencent.com/developer/article/1176291 https://www.cn ...
- python+Appium自动化:记录遇到的坑
1.打开 uiautomatorviewer同步的的时候突然报错 Error while obtaining UI hierarchy XML file: com.android.ddmlib.Syn ...
- 第八章 watch监听 85 computed-计算属性的使用和3个特点
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- qspi nor
qspi: sf probe SF: Detected s25fl256s_256k with page size 512 Bytes, erase size 256 KiB, total 32 Mi ...
- PXE远程自动安装操作系统
一.PXE的工作原理 PXE:基于Client/Server的网络模式,支持远程主机通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统:PXE可以引导和安装Windows,linux等多种操 ...
- pycharm图像不能显示,之前是可以显示的。显示一两次突然不显示了
网上说是什么包问题的就说了.我遇到一个非常奇葩的问题 因为你的设置可能是这样 每次都在窗口右侧的工具栏那边显示.可能突然心情不佳就不显示了.然后你再把勾去掉即可.你要喜欢再点上也行.
- idea操作mysql数据库添加汉字时出现乱码解决方案
首先 然后 最后 在连接数据库后面加一个指定编码格式 编码格式: characterEncoding=UTF-8
- 回调函数c++类中实现
https://blog.csdn.net/mrailence/article/details/52251201 https://blog.csdn.net/qq_14820081/article/d ...