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.
精彩评论