1,EditText控件

① 修改光标颜色

自定义drawable 创建cursor.xml文件

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

控件中添加使用

android:textCursorDrawable="@drawable/cursor"

效果如下:

②修改选中图标

创建我们是这种两边类似于水滴效果的,现在我们来自定义一下

在EditText中设置这两个属性

 android:textSelectHandleLeft="@mipmap/ic_launcher"
android:textSelectHandleRight="@mipmap/ic_launcher"

效果如下:

但是发现小米手机好像不行,不知道怎么回事  

③选中颜色与EditView默认的下划线

android:backgroundTint="#9bd435"
android:textColorHighlight="#9bd435"

效果如下:  

使用我们的Material Design主题来解决,先看看我们的效果吧

直接设置内容的颜色就行了,及我们的colorAccent属性。

2,ScrollView控件

①修改滑动条的样式

 android:scrollbarThumbVertical="@drawable/scrollbar" 自定义滚动条颜色、样式
android:scrollbars="vertical" 滚动条的滑动效果
android:scrollbarStyle="insideInset" 滚动条相对于View在的位置

②修改滑动到顶部或者底部的效果

android:overScrollMode="never"

  

  

Android -- 常见控件的小效果的更多相关文章

  1. Android设置常见控件点击效果

    一. Imageview的点击效果——图片稍微变暗突出点击效果 public class ClickImageView extends AppCompatImageView { public Clic ...

  2. Android --> 常见控件

    1.TextView  主要用于界面上显示一段文本信息 2.Button  用于和用户交互的一个按钮控件 //为Button点击事件注册一个监听器public class Click extends ...

  3. Android常见控件— — —ProgressDialog

    package com.example.uiwidgettest2; import android.app.Activity;import android.app.AlertDialog;import ...

  4. Android常见控件— — —AlertDialog

    package com.example.uiwidgettest2; import android.app.Activity;import android.app.AlertDialog;import ...

  5. Android常见控件— — —ProgressBar

    ProgressBar用于在界面上显示一个进度条,表示我们的程序正在加载一些数据. <?xml version="1.0" encoding="utf-8" ...

  6. Android常见控件— — —EditText

    <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=" ...

  7. Android常见控件— — —Button

    <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...

  8. Android常见控件— — —TextView

    <?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android=&qu ...

  9. Android给控件添加默认点击效果

    Android控件点击效果 Android中Button控件是有点击效果的,但是像TextView.ImageView.各种Layout是没有点击效果的,给TextView设置点击事件后,加个点击效果 ...

随机推荐

  1. Leetcode jump Game

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  2. requirejs:模块加载(require)及定义(define)时的路径小结

    原文地址:http://www.tuicool.com/articles/7JBnmy 接触过requirejs的童鞋可能都知道,无论是通过define来定义模块,还是通过require来加载模块,模 ...

  3. 【BZOJ】3526: [Poi2014]Card

    题意 \(n(n \le 200000)\)张卡片,正反有两个数\(a[i], b[i]\).\(m(m \le 1000000)\)次操作,每次交换\(c[i].d[i]\)位置上的卡片.每一次操作 ...

  4. ZeroMQ接口函数之 :zmq_proxy_steerable – 以STOP/RESUME/TERMINATE控制方式开启内置的ZMQ代理

    ZeroMQ API 目录 :http://www.cnblogs.com/fengbohello/p/4230135.html ——————————————————————————————————— ...

  5. jquery.cookie.js && java后台代码 操作cookie实现记住当前用户输入信息代码

    下载jquery.cookie.js地址看这里:http://pan.baidu.com/s/1gdCPaN5 //初始化页面时验证是否记住了密码 $(document).ready(function ...

  6. 关于如何在MVC中 执行JS

    Response.Write("<script>KHTPREFERENCE()</script>"); return this.MessageResult( ...

  7. HTML语法大全

      卷标 , 属性名称 , 简介  002 <! - - ... - -> 批注  003 <!> 跑马灯  004 <marquee>...</marque ...

  8. thinkphp2

  9. 那些年一起用过的iOS开发利器之Code Pilot

    本系列所有工具的简介见:http://www.cnblogs.com/lloydsheng/p/3637606.html 什么是Code Pilot? Code Pilot是一个Xcode的扩充套件, ...

  10. Log4J 配置文件全属性详解

    第一步:加入log4j-1.2.8.jar到lib下. 第二步:在CLASSPATH下建立log4j.properties.内容如下: 1 log4j.rootCategory=INFO, stdou ...