问题描述:想给某一按钮增加点击效果-比如系统点击效果 android:background="?android:attr/selectableItemBackgroundBorderless"
使用:
1:xml控件中设置android:background="?android:attr/selectableItemBackgroundBorderless"
2:该活动页面设置主题android:theme="@style/xxx"
3:注意parent一定要写“ Theme.MaterialComponents.DayNight.NoActionBar ” 才能生效哟
<style name="xxx" parent="Theme.MaterialComponents.DayNight.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">#00000000</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowFullscreen">true</item> <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item> </style>