0

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.

sergi
  • 969
  • 5
  • 14
  • 22

1 Answers1

3

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.

Cristian
  • 198,401
  • 62
  • 356
  • 264
  • Great! That did the trick! I don't know what I was thinking.. I was already using a ViewFlipper (SafeViewFlipper for that matter..) in another control of my app.. – sergi Apr 18 '11 at 18:35