I am stuck with creating a simple design using Tabs widget in Android.
Please help me to create a similar design.
Just note that , the bottom border is not at the bottom of the box and also its width is much less than the width of the box.
I am stuck with creating a simple design using Tabs widget in Android.
Please help me to create a similar design.
Just note that , the bottom border is not at the bottom of the box and also its width is much less than the width of the box.
If you are using TabLayout
then you can use setCustomView to set custom tab.
TabLayout tabLayout = (TabLayout) findViewById(R.id.sliding_tabs);
tabLayout.setupWithViewPager(viewPager);
// Iterate over all tabs and set the custom view
for (int i = 0; i < tabLayout.getTabCount(); i++) {
TabLayout.Tab tab = tabLayout.getTabAt(i);
tab.setCustomView(pagerAdapter.getTabView(i));
}
Checkout here for full example