1

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?

4

1 回答 1

3

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.

于 2011-05-30T22:17:24.517 回答