2010-06-23 4 views
2

Je veux faire un contrôle onglet sur Android. Mais le contrôle onglet est affiché en haut, où je veux qu'il soit affiché la ligne de fondTabcontrol sur android

Quelqu'un peut-il aider à ce

Répondre

1

L'objet tabwidget dans votre mise en page est la vue qui contiendra les onglets. Vous pouvez le déplacer à la position que vous voulez sur l'écran.

Voici un exemple sur la façon de l'obtenir au bas de l'écran avec un RelativeLayout

<?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"> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 

     ... 

     <TabWidget 
     android:id="@android:id/tabs" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true"/> 

    </RelativeLayout>