android按钮主题下载,android Material主题中的button效果
在android5.0新增了ripple的效果,他可以运用到Button,ImageButton,TextView,以及一些布局容器。首先,我们看android:Theme.Material.Light主题中设置的各种ripple效果属性的默认值:1.@drawable/item_background_material2.@drawable/item_background_borderless_m
在android5.0新增了ripple的效果,他可以运用到Button,ImageButton,TextView,以及一些布局容器。
首先,我们看android:Theme.Material.Light主题中设置的各种ripple效果属性的默认值:
1.@drawable/item_background_material
2.@drawable/item_background_borderless_material
3.@style/Widget.Material.Light.Button.Borderless
4.@style/Widget.Material.Light.Button.ButtonBar.AlertDialog
selectableItemBackground在drawable文件中文件内容为:
android:color="?attr/colorControlHighlight">
selectableItemBackgroundBorderless在drawable文件中文件内容为:android:color="?attr/colorControlHighlight" />
borderlessButtonStyle最后引用的style就是如下:
@drawable/btn_borderless_material
@null
他实际上就是设置了background的属性:
android:color="?attr/colorControlHighlight">
android:drawable="@drawable/btn_default_mtrl_shape" />
buttonBarButtonStyle实际上也是调用了borderlessButtonStyle的style,就是也是调用了相同的backgroung:
@drawable/btn_borderless_material
@null
?attr/colorAccent
@anim/disabled_anim_material
前两种在xml中设置background即可,如:
android:background="?android:selectableItemBackground"
前两种在xml中设置style即可,如:
style="?android:buttonBarButtonStyle"
更多推荐
所有评论(0)