2011-02-12 4 views
1

J'essaie de positionner deux boutons l'un en dessous de l'autre avec un peu de rembourrage. Malheureusement, le bas remplit tout l'écran et passe derrière le haut. : -Smodèle de disposition du tableau de bord

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="6dip"> 
    <LinearLayout 
     android:id="@+id/linearLayout1" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:orientation="horizontal" 
     android:padding="6dip" 
     android:layout_weight="1"> 
     <ImageButton 
      android:layout_width="wrap_content" 
      android:src="@drawable/gallery" 
      android:layout_height="wrap_content" 
      android:scaleType="centerInside" 
      android:id="@+id/gallery_btn"></ImageButton> 
    </LinearLayout> 
    <LinearLayout 
     android:id="@+id/linearLayout2" 
     android:orientation="horizontal" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent" 
     android:padding="6dip" 
     android:layout_weight="1"> 
     <ImageButton android:id="@+id/camera_btn" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/camera" 
      android:scaleType="centerInside" /> 
    </LinearLayout> 
</LinearLayout> 
+0

tourne le plugin Eclipse ADT a un visualiseur graphique foiré. Les boutons s'affichent correctement sur un périphérique réel – siamii

Répondre

5

Roman Nurik (@romannurik) a écrit un tableau de bord personnalisé de classe mise en page qui simplifie la création d'un tableau de bord: Vous pouvez le trouver à https://gist.github.com/882650

+0

comment utiliser cette classe? – Anuj

Questions connexes