Android——为某个控件或者LinearLayout等添加水波纹效果
16lz
2021-01-23
很多时候直接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才会有效果。
更多相关文章
- 查看android里的数据库的内容的方法
- 让android定时关机的实现方法
- android Listview中button 和Listview可同时点击的方法
- android添加后门的一种方法
- Android ViewGroup中有关测量的方法
- android 中 unable to start service 错误解决方法