Most of the time a
TabLayout is used together with a ViewPager, in order to get the swipe functionality that comes with it.
It is possible to use a
TabLayout without a
ViewPager by using a
First, add a
TabLayout to your activity's XML file:
For navigation within an
Activity, manually populate the UI based on the tab selected.
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0