Up next

Android tutorial (2018) - 53- Swipe View with Tabs

7 Views· 14 Aug 2019
ITCOURSES
ITCOURSES
5 subscribers
0

In this video we are going to create a simple example app that demonstrate how to use the ViewPager widget with TabLayout for creating swipe views in your android application.

ViewPager is a widget that contains many child views and each child view represent each page. You can use Fragments for representing each page in the swipe view. If there is a limited number of pages then you can use the FragmentPagerAdapter. If there is large number of pages then you have to use FragmentStatePagerAdapter.

In our example app we have only 3 pages and we use a common fragment for display each page.

You can easily configure a TabLayout with ViewPager widget by simple call the setUpWithPager method on the tabLayout and pass the ViewPager object as parameter.

In-order to set the Tab titles you have to override the getPageTitle method in the ViewPager Adapter class.

Like my Facebook page : https://www.facebook.com/codeglympse
Subscribe My YouTube channel : http://www.youtube.com/ticoontechnologies

Show more
100% online learning from the world's best universities, organisations and Instructors

 0 Comments sort   Sort By


Up next