2010-07-14 2 views
3

Je veux me débarrasser de la barre de défilement horizontale dans TabHost. C'est là même si TabWidget est au top.Comment se débarrasser de la barre de défilement horizontale dans tabhost?

alt text http://img341.imageshack.us/img341/1879/brokentabs.png

ci-dessous est ma mise en page XML.

<?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" > 
    <FrameLayout 
     android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent"  
     android:layout_height="fill_parent"/>     

    <TabWidget 
     android:id="@android:id/tabs"      
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:gravity="bottom" /> 
</TabHost> 

Répondre

3

Nest dans un LinearLayout

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 

    android:gravity="center_horizontal">  
    <TabHost 
    android:id="@android:id/tabhost"  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    > 
... 
... 
... 
    </TabHost> 
    </LinearLayout> 
+0

Essayé. Ne travaille pas pour moi. – Geek

2

Mettre cela a fonctionné pour moi dans la mise en page du cadre:

android:foreground="@null" 
android:layout_marginTop="-6dp" 
Questions connexes