【发布时间】:2016-09-28 04:28:50
【问题描述】:
我的 XML 代码:
<Button
android:id="@+id/link_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/google_btn" />
我正在应用默认的涟漪效果
<Button
android:id="@+id/link_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground" />
但我需要按钮背景"@drawable/google_btn" 和"?android:attr/selectableItemBackground"。这意味着我需要自定义背景的涟漪效果。
【问题讨论】:
-
我该怎么做
-
值得强调的是(正如@zahidul 提到的),涟漪效应仅适用于 Android v21 及更高版本。
标签: android background android-drawable ripple