很多时候直接background添加那三种:

1.android:background=“?android:attr/selectableItemBackground”波纹有边界
2.android:background=“?android:attr/selectableItemBackgroundBorderless”波纹超出边界,就是一个圆型

还有一种就是button默认的。

可能一时无法改变背景,一种方法是外面套一个LinearLayout等设置背景色,还有个方法就是在drawer里面建 ripple。

<?xml version="1.0" encoding="utf-8"?><ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/colorPrimary">    <item >        <shape>            <solid android:color="@color/white">solid>        shape>    item>ripple>

同样可以,要注意的是,控件有的默认不可点击,需要设置onclick为true才会有效果。

更多相关文章

  1. 查看android里的数据库的内容的方法
  2. 让android定时关机的实现方法
  3. android Listview中button 和Listview可同时点击的方法
  4. android添加后门的一种方法
  5. Android ViewGroup中有关测量的方法
  6. android 中 unable to start service 错误解决方法

随机推荐

  1. 转载:android 进程保活
  2. Android.InstallDevelopmentEvn
  3. Android(安卓)Tricks: How to Decompile
  4. Android(安卓)马赛克(Mosaics)效果
  5. Android的线程使用来更新UI----Thread、H
  6. Android(安卓)记事本NotePad
  7. 待验证内容。
  8. 通过html页面打开Android本地的app
  9. android ContentProvider
  10. Android模糊处理实现图片毛玻璃效果