Android——为某个控件或者LinearLayout等添加水波纹效果
2017-11-01 20:18
330 查看
很多时候直接background添加那三种:
1.android:background=“?android:attr/selectableItemBackground”波纹有边界
2.android:background=“?android:attr/selectableItemBackgroundBorderless”波纹超出边界,就是一个圆型
还有一种就是button默认的。
可能一时无法改变背景,一种方法是外面套一个LinearLayout等设置背景色,还有个方法就是在drawer里面建 ripple。
同样可以,要注意的是,控件有的默认不可点击,需要设置onclick为true才会有效果。
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设置Gridview中的内容不滚动,然后控件中的内容随便添加的效果。
- Android控件使用水波纹效果
- android中给TextView或者Button的文字添加阴影效果
- android中给TextView或者Button的文字添加阴影效果
- android 自定义粘性View,可寄生于其他控件给予其添加半透明spinner的效果
- android 自定义粘性View,可寄生于其他控件给予其添加半透明spinner的效果
- Android 给图片、文字、控件、布局添加阴影效果(悬浮效果)
- [Android | Material Design] RecyclerView Item点击事件 添加水波纹效果 两种办法
- android 给LinearLayout中添加一定数量的控件,并让着一定数量的控件从右到左移动,每隔若干秒停顿一下,最后一个view链接第一个view,然后继续移动循环往复,形成一个死循环简单动画效果
- android appcompat_v7 去掉点击效果或者自定义水波纹颜色
- Android 给控件添加边框阴影效果
- Android 添加点击效果(5.0之后水波纹效果)
- android中给TextView或者Button的文字添加阴影效果
- Android自定义View控件实现多种水波纹涟漪扩散效果
- Android设置Gridview中的内容不滚动,然后控件中的内容随便添加的效果。
- Android设置Gridview中的内容不滚动,然后控件中的内容随便添加的效果。
- Android六大布局的介绍 Android开发布局:.xml 页面排版 1.线性布局(LinearLayout) LinearLayout是线性不布局控件,它包含的子控件将以横向或者竖向的方式
- jQuery EasyUI动态添加控件或者ajax加载页面后不能自动渲染问题的解决方法
- android 开发技巧(9)--为文本添加发亮的效果
- Android自定义PopupWindow显示在控件上方或者下方