If you want add the Android default background behavior to make a Layout
acts like a "clikable" View
, set on the targeted Layout
:
API 11+ (Pure Android):
android:background="?android:attr/selectableItemBackground"
API 7+ (Android + AppCompat Support Library):
android:background="?attr/selectableItemBackground"
Any API:
android:background="@android:drawable/list_selector_background"
Answers above still true but didn't help me for just add the default pressed and released UI state (like in a ListView
for instance).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…