Вы можете использовать этот код для этого
TabWidget widget = getTabWidget();
final int tabChildrenCount = widget.getChildCount();
LinearLayout.LayoutParams currentLayout;
for (int i = 0; i < tabChildrenCount; i++) {
currentLayout = (LinearLayout.LayoutParams) widget.getChildAt(i).getLayoutParams();
if (i == 0) {
currentLayout.setMargins(10, 0, 5, 0);
} else if (i == (tabChildrenCount - 1)) {
currentLayout.setMargins(5, 0, 10, 0);
} else {
currentLayout.setMargins(5, 0, 5, 0);
}
currentLayout.height = 40;
}
widget.requestLayout();