Forum Xamarin.Android

Layout problem when adding tabs widget

Hi,
I have added tab widget inside the linerLayout, i have set the width to fill_parent or match_parent. but it still has gap between the layout and tab widget, how can i avoid this gap?

Posts

  • CheesebaronCheesebaron DKInsider, University mod

    Does any of it have a margin set?

  • PEIJUNLUPEIJUNLU CNMember

    nope, i leave it as blank and already tried set all of them 0px. neither worked.

  • DWestyDWesty USMember ✭✭

    Can you post your xml?

  • PEIJUNLUPEIJUNLU CNMember
    edited July 2013

    yes, Dwesty,
    bleow are my xml file codes:

    <?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"
    
        android:padding="5dp">
    
        <FrameLayout
    
            android:id="@android:id/tabcontent"
    
            android:layout_width="match_parent"
    
            android:layout_height="match_parent"
    
            android:layout_weight="1"
    
            android:alwaysDrawnWithCache="true" />
    
        <TabWidget
    
            android:id="@android:id/tabs"
    
            android:layout_width="fill_parent"
    
            android:layout_height="wrap_content" />
    
    </LinearLayout>
    

  • PEIJUNLUPEIJUNLU CNMember
    edited July 2013

    the code automatically generate mess when i click save, i have done a screenshoot for a better view.

    1.png 101.4K
  • CheesebaronCheesebaron DKInsider, University mod

    The LinearLayout has a padding...

  • PEIJUNLUPEIJUNLU CNMember

    oh my....thanks you very much cheesebaron

  • CheesebaronCheesebaron DKInsider, University mod

    Press that like button if you find it useful ;)

Sign In or Register to comment.