How do I get action buttons with custom layouts to be styled like standard action buttons in Android 3.0+

纵然是瞬间 提交于 2019-12-05 14:49:34

Ah, sorry to answer my own question but I have just stumbled upon a way to do this. I was halfway there - you need your custom layout's style to inherit from ActionButton:

@android:style/Widget.ActionButton

but then you also need to make the layout clickable:

android:clickable="true"

for it to work. Using both of these makes the custom action buttons look just like the regular ones when you press them.

Hopefully that'll help someone trying to do this!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!