【发布时间】:2015-11-03 16:15:48
【问题描述】:
背景
在 Android 的拨号器应用中,当您开始搜索某个内容时,单击 EditText 左侧的箭头按钮,您会在其上获得圆形波纹效果:
问题
我也试过了,但我得到了一个长方形的:
<ImageButton
android:id="@+id/navButton"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:background="?android:attr/selectableItemBackground"
android:src="@drawable/search_ic_back_arrow"/>
问题
如何使按钮在被点击时产生圆形波纹效果?我必须创建一个新的可绘制对象,还是有内置的方法?
【问题讨论】:
-
考虑将您选择的答案更改为投票最多的答案,因为它实际上解决了问题
-
@JeffBarger 为什么?两者都工作正常。他们之间没有比这更好的了。
标签: android button rippledrawable