Reputation: 689
I am trying to resize notification tab at the start of tab layout as in image,
Till now I am able to bring all three tabs as in image except the width. My progress till now is as follow,
So my question is, how do I resize individual items in a tab layout? I searched on many pages and tried reading the documentation but didn't find anything useful.
Thank you in advance.
Upvotes: 2
Views: 2297
Reputation: 144
This is late but better late than never. Also I can't see how Parth Patel answer is even related to this question. Have a look at this, you will find what you are looking for.
LinearLayout layout = ((LinearLayout) ((LinearLayout) tabLayout.getChildAt(0)).getChildAt(YOUR_TAB_NUMBER));
LinearLayout.LayoutParams layoutParams = (LinearLayout.LayoutParams) layout.getLayoutParams();
layoutParams.weight = YOUR_WEIGHT; // e.g. 0.5f
layout.setLayoutParams(layoutParams);
Upvotes: 6