I have a question that I am implementing a tab bar in my android app but Tab host displays some extra margins from left, right, top and bottom which is looking so ugly, So how can we remove these extra spaces from Tab Host. You can understand easily by attached picture with red circled extra spaces.
Please suggest me the right answer regarding the same.
Xml Layout:
<?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" android:layout_marginLeft="0dip" android:layout_marginRight="0dip" android:layout_marginTop="0dip"
android:layout_marginBottom="0dip" xmlns:android1="http://schemas.android.com/apk/res/android">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp"
android:layout_weight="1"
android:layout_marginTop="-6dp"
/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</TabHost>
You probably have
android:paddingset container layout of yourTabHostor you haveandroid:layout_marginset in the layout you add to the container.Post both XML files if you want more specific help.
Edit
Based on your XML file you have
android:padding="5dp"set in both yourFrameLayoutand yourLinearLayout. Remove those, and you the excesive padding will dissappear.