Edittext 的光标颜色:

在xml布局文件中
android:textCursorDrawable=”@null” 表示光标的颜色和字体的颜色一样

当然,我们也可以自定义光标的颜色,在drawable文件夹下写个edit_cursor_color.xml文件

<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"    android:shape="rectangle" >    <size android:width="2dp" />    <solid android:color="#ff7200" />shape>

然后 android:textCursorDrawable=”@drawable/edit_cursor_color”

Edittext 的背景颜色:

设置系统的 EditText 是一条下划线,自定义一条下划线的背景色

<?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="#eeeeee"                android:startColor="#eeeeee" />        shape>    item>layer-list>

效果完全就是上图效果。

更多相关文章

  1. Android(安卓)EditText自动获取焦点并弹出软键盘,解决EditText在
  2. Fragment+viewpager 傻子都能看懂的demo 实例(博主就是个傻子)
  3. android shape总结 和控制的风格定制
  4. 取消默认Listview点击的显示的颜色
  5. android TextView的字体颜色设置的多种方法(续)
  6. android TextView的字体颜色设置的多种方法(续)
  7. android TextView的字体颜色设置的多种方法(续)
  8. android TextView的字体颜色设置的多种方法(续)
  9. Android隐藏ListView分割线

随机推荐

  1. Android实现垂直型的SeekBar
  2. Android设备到底侵犯了微软的什么专利
  3. Android面试看重你什么?(推荐!!!)
  4. 另一个视角搞android——《Android软件安
  5. 深入Android【一】—— 序及开篇
  6. 你想加入IT高薪就业的队伍吗?还在犹豫什么
  7. Android(安卓)屏幕元素层次结构
  8. MDCC印象之三:Android热的背后
  9. Frida官方手册 - 在Android上使用Frida
  10. Android设备的唯一ID