开发者

How to highlight clicks in app widget?

I have an app widget which runs neatly. However, I am unable to highlight a click on a linked item. I've seen it in the standard app widgets like 'Music' and 'Power Control', for instance. Moreover, I've also been studying t开发者_开发问答he Music app widget's source at album_appwidget.xml. The only thing I could think of is the LinearLayout defined at lines 23-35 which states

android:clickable="true"

Unfortunately, this does not work for me. So does anyone have a hint on how to highlight a click on an app widget? I've tried the LinearLayout, TextView and Button. None of them displayed a border as a highlight.

Thanks in advance, Steff


you need to create images for those states like focussed state, pressed etc like in a button and define them in your background. Try looking at the custom buttons where its explained how to accomplish the task thats similar to your needs. http://www.gersic.com/blog.php?id=56. if you want to look more and add more states you may ge better idea if you look at the android source code for buttons where they have images for each state of the button and every other widget.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜