I am using Google\'s SlidingTabLayout. As i only have 3 tabs to be displayed, I am seeing empty space after last tab.
Please screenshot below.
more dynamic approach is
Edit SlidingTabLayout.java
locate private void populateTabStrip() method and replace
mTabStrip.addView(tabView);
with
// get dimension of current layout
DisplayMetrics display = this.getResources().getDisplayMetrics();
int width = display.widthPixels;
//your tab names here
String[] tabTitles = {"tab1", "tab2", "tab3"}
// compare max width and number of tabs's length
//will not fit to the maxwidth it will distribute the tabs evenly
if(width%(width/tabTitles.length) == 0){
mTabStrip.addView(tabView,
new LinearLayout.LayoutParams(width/tabTitles.length, ViewGroup.LayoutParams.WRAP_CONTENT));
} else {
mTabStrip.addView(tabView);
}