سؤال

Here is what I wish to implement..

A slider like thing...

Say My app is a game with 4x4 array of level buttons in each screen and there are totally 3 screens...

The user should be able to swipe his finger from right to left and the slider should "slide" to next 4x4 set of levels...

Just like what the phone functions while we open apps from homescreen.
And if the user swipes his finger from right to left and there are no levels to the left, the slider should bounce back...

So... What I ask is which layout/view/class to use to implement such a slider?

Also, plz inform me how can I implement such a slider which switches between tabs as well (each tab containing different layouts).. I hope I made myself clear...

هل كانت مفيدة؟

المحلول

As i understand you can use:

All of this approaches uses adapters and listeners - you can find a lot of examples in internet. I think in your case viewPager is mor useful, because as i understand you want to have many different views.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top