![]() ![]() ![]() By using this method we add the tab which we created using newTab() method in the TabLayout. addTab(Tab tab): This method is used to add a tab in the TabLayout. TabLayout.Tab firstTab = tabLayout.newTab() // Create a new Tab namesįtText("First Tab") // set the Text for the first TabįtIcon(R.drawable.ic_launcher) // set an icon for the first tabĢ. TabLayout tabLayout = (TabLayout) findViewById(R.id.simpleTabLayout) // get the reference of TabLayout Let’s we discuss some important methods of TabLayout that may be called in order to manage the TabLayout.ġ. newTab(): This method is used to create and return a new TabLayout.Tab.īelow we create a new tab and set the text and icon for the tab. ![]() 5 Example 2 of TabLayout Using ViewPager:. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |