开发者

How to put multiple selectors in one xml file and reference them from layout xml file?

I have a layout file with 6 image buttons. Each button should show different source image based selection/focus/noselection. I am able to do this with 6 xml files under drawable folder with selector nodes.

Is there a way to put all these selector nodes in ONE xml file to accomplish the same. Less files means less开发者_如何学C management...


Yes but you must manage it from the code with:

public class MyClass extend Activity implements OnSelect,OnFocus

if you use eclipse write "On" and click ctrl+spaceBar and select what you need and change the icon with myButtonName.src="@drawble/myimageonselect"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜