custom view
for each TAB
. custom view
to each TAB
by using TAB.setCustomView(custom_View) Try this:
// Tab
Tab tab = YourTabLayout.getTabAt(position);
// Get Custom view using LayoutInflater
// ...........
// Set custom view
tab.setCustomView(custom_View);
You will need to add a custom View
to each tab. so once you have your ViewPager
and Adapter
all set up.
Iterate over the tabs and add custom views.
something like:
for (int i = 0; i < tabLayout.getTabCount(); i++) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
tab.setCustomView(createCustomViewForTab(i);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.