Android:通过代码更改按下/聚焦的资源
我正在使用一些调整,允许用户使用他们的 SDCard 资源更改我的应用程序的 UI。这真的很简单,没什么特别的,我只是使用“setImageDrawable”或“setImageBitmap”。
http://developer.android.com/reference/android/widget/ImageButton。 html
这真的很酷,我的所有用户都很乐意自定义 UI。
但现在,我还想更改按钮的按下/聚焦资源!
现在,当他们点击它时,他们看不到任何东西,而且他们可能点击了 10 次。更成问题的是,这并不直观。
所以我想以编程方式更改按下/聚焦状态...
任何想法建议?
I am using some tweaks that allow the user to change the UI of my application with ressources from their SDCard. That's really easy and nothing special, I just use the "setImageDrawable" or "setImageBitmap".
http://developer.android.com/reference/android/widget/ImageButton.html
That's really cool and all my users are happy to customize the UI.
But now, I would like to also change the pressed/focused ressource of the button!
Now, when they click on it, they cannot see anything and they click maybe 10 times. And more problematic, that's not really intuitive.
So i would like to change also the pressed/focused state programmatically...
Ani idea suggestion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使所有 ImageButton 具有 StateListDrawable 而不是 BitmapDrawable。
You'll have to make all of your ImageButtons have a StateListDrawable instead of BitmapDrawables.