2011-03-02 4 views
0

Je veux créer un assistant comme mise en page qui devrait ressembler à décrit: * en haut devrait être une sorte de titre de la boîte de dialogue en cours * en bas devrait être une barre de navigation contenant des boutons pour suivant/précédent et diverses opérations. Cette barre devrait toujours (!) Être tout en bas de l'écran. * au centre devrait être une liste (devrait utiliser tout l'espace restant, sauf la barre de titre et la barre de navigation décrites ci-dessus)Assistant comme mise en page en android

Mon premier essai est posté ci-dessous. J'ai utilisé framelayout mais on m'a dit que c'était une mauvaise idée. Le problème que j'ai rencontré est que la dernière rangée de ma liste est en dessous de la barre avec les boutons en bas de l'écran. Avez-vous des suggestions sur la façon dont je pourrais résoudre mon problème?

Merci

Voici mon projet ne fonctionne pas:

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

<LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:orientation="vertical" > 

    <LinearLayout android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:orientation="horizontal" style="@android:style/ButtonBar"> 

     <ImageView android:src="@drawable/person" 
      android:layout_width="wrap_content" android:layout_height="wrap_content" /> 

     <TextView android:text="@string/personstring" 
      android:layout_width="wrap_content" android:layout_height="wrap_content" 
      android:textStyle="bold" android:textAppearance="?android:attr/textAppearanceLarge" /> 

    </LinearLayout> 


    <ListView android:visibility="visible" android:id="@android:id/list" 
     android:layout_width="fill_parent" android:layout_height="fill_parent" /> 


</LinearLayout> 
<LinearLayout android:id="@+id/footer" 
     android:layout_width="fill_parent" android:layout_height="wrap_content" 
     android:orientation="horizontal" android:layout_gravity="bottom|center" 
     android:layout_alignParentBottom="true" style="@android:style/ButtonBar"> 

     <ImageButton android:id="@+id/loacreation.previousButton" 
      android:layout_width="wrap_content" android:layout_height="wrap_content" 
      android:layout_weight="1" android:src="@drawable/buttonarrowleft" /> 

     <ImageButton android:id="@+id/loacreation.nextButton" 
      android:layout_width="wrap_content" android:layout_height="wrap_content" 
      android:layout_weight="1" android:src="@drawable/buttonarrowright" /> 
    </LinearLayout> 


</FrameLayout> 

Répondre

1

Utilisez un RelativeLayout comme contenant plus à l'extérieur, et la LinearLayout qui contient vos boutons peuvent avoir android: layout_alignParentBottom = "true".