@act262
2017-08-09T11:48:05.000000Z
字数 1565
阅读 1205
theme
selectableItemBackground
表现为方形的效果
selectableItemBackgroundBorderless
表现为圆形的效果,没有边界
actionBarItemBackground
、controlBackground
表现为圆形的波纹效果
values
目录下的样式
<!-- Base.V7.Theme.AppCompat.Light -->
<item name="selectableItemBackground">@drawable/abc_item_background_holo_light</item>
<item name="selectableItemBackgroundBorderless">?attr/selectableItemBackground</item>
...
<!-- Action Bar Styles -->
<item name="actionBarItemBackground">?attr/selectableItemBackgroundBorderless</item>
...
<item name="controlBackground">?attr/selectableItemBackgroundBorderless</item>
<!-- Toolbar styles -->
<item name="toolbarStyle">@style/Widget.AppCompat.Toolbar</item>
<item name="toolbarNavigationButtonStyle">@style/Widget.AppCompat.Toolbar.Button.Navigation</item>
values-v21
目录下的样式
<style name="Base.V21.Theme.AppCompat" parent="Base.V7.Theme.AppCompat">
<!-- General view attributes -->
<item name="selectableItemBackground">?android:attr/selectableItemBackground</item>
<item name="selectableItemBackgroundBorderless">?android:attr/selectableItemBackgroundBorderless</item>
<item name="borderlessButtonStyle">?android:borderlessButtonStyle</item>
</style>
values
目录下的theme_material.xml
<style name="Theme.Material">
...
<item name="selectableItemBackground">@drawable/item_background_material</item>
<item name="selectableItemBackgroundBorderless">@drawable/item_background_borderless_material</item>
<item name="borderlessButtonStyle">@style/Widget.Material.Button.Borderless</item>
...
</style>