Use gallery instead of ViewSwitcher

996 Views Asked by At

I currently use a ViewSwitcher in my app but now I'm facing a problem because I need more than 2 views to switch between. As ViewSwitcher does not accept more than 2 children, I've read that it's possible to use the Gallery widget to do so.

Each view in the ViewSwitcher is different (one is a LinearLayout with a ListView and a Button inside and the other one is a LinearLayout with an ImageView and a TextView inside).

Will I be able to use the Gallery widget given my requirements?

Can anyone point me to the right direction? Some tutorial/example or so..?

Thank you.

1

There are 1 best solutions below

1
On BEST ANSWER

Use ViewFlipper which allows you more than 2 views and it's almost identical to ViewSwitcher (since both have the same super class). I don't recommend using GalleryView in this case since all your views will be different, thus your Gallery's adapter will look like a pile of crap.