this is my tab it has extra some spaces i need to remove them. this is my code
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:padding="0dip"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
</TabHost>
mainactivity class:
public class MainActivity extends TabActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabHost = getTabHost();
// Tab for Photos
TabSpec photospec = tabHost.newTabSpec("Photos");
// setting Title and Icon for the Tab
photospec.setIndicator("Photos");
// photospec.setText("da");
Intent photosIntent = new Intent(this, SplashActivity.class);
photospec.setContent(photosIntent);
// Tab for Videos
TabSpec videospec = tabHost.newTabSpec("Videos");
videospec.setIndicator("Videos");
Intent videosIntent = new Intent(this, MainActivity.class);
videospec.setContent(videosIntent);
// Adding all TabSpec to TabHost
tabHost.addTab(photospec); // Adding photos tab
tabHost.addTab(videospec); // Adding videos tab
}
}
i tried to change the size of the tab in layout like this
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="23dp"
android:padding="0dip" />
if i do this text will be hidden.
when i reduce the height it becomes like this and text also hides