Reputation: 4103
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>
Upvotes: 0
Views: 1611
Reputation: 16570
You probably have android:padding
set container layout of your TabHost
or you have android:layout_margin
set 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 your FrameLayout
and your LinearLayout
. Remove those, and you the excesive padding will dissappear.
Upvotes: 2
Reputation: 527
You can set Your android:padding="0px"
or you can remove your padding or try android:layoutMargin
or android:padding
or you try to gime some code
Upvotes: 0