开发者

change the look of Gallery selected item

i have "Gallery" on my layout, and i created a class inherits from BaseAdapter, to set it as Gallery adapter

GalleryAdapter extends BaseAdapter 

and i used it开发者_开发技巧

setAdapter(new GalleryAdapter

and it works fine.

but now i need to change the selected view within the gallery, i need it within the adapter.

is there anyway to know if this "View" is selected from the Adapter so i can change the look of it?


The easiest way to do this is to create a statelist drawable (see here) and customize the "selected" state to whatever you want there. Then you provide this drawable as the background for the item.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜