Reputation: 472
Like the new UI of WhatsApp where camera icon (1st tab) is having small width and all other 3 tabs are having same width. How can we achieve same in tab layout ?
Upvotes: 1
Views: 1008
Reputation: 1650
You can create a custom layout for the tab and set the dimension whatever you want and inflate that layout and set the custom view method with this inflated layout
View customView = LayoutInflater.from(getContext()).inflate(R.layout.custom_layout, null);
Tab tab=new TabLayout.Tab()
tab.setCustomView(customView)
mLayout.addTab(tab)
Upvotes: 1