Question

I've follow a tutorial for use ViewPAger widget and implement swiping view for navigate to my app. Every tutorial i've follow use justo one simple static xml file to show in each tab (i just modify a textview). I need to create a different view with different content and swipe it. How can i do?

Was it helpful?

Solution

I am not sure if I understand your question correctly, but I think this is what you are looking for:

How to implement a ViewPager with different Fragments / Layouts

The basic idea is that you have a different Fragment class for each different layout you have. In this case, all Fragments have a TextView, but their layouts also differ in a separate background color.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top