This is how the field is set for four different tabs. You can change the values ββof the setMargins functions (v1, v2, v3, v4) to get a suitable setting for the number of tabs you work with. Hope this helps. Note that tabHost is a TabHost object that hosts the different tabs that you work with.
Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth(); View currentView; for(int i=0;i<tabHost.getTabWidget().getChildCount();i++) {
source share