2010-08-10 6 views
0

J'ai un LinearLayout horizontal. Ce LinearLayout a une case à cocher à côté d'un autre LinearLayout. La largeur/hauteur de la case à cocher est wrap_content, tandis que la LinearLayout intérieure est fill_parent/wrap_content. Le paramètre layout_weight du LinearLayout interne est défini sur 1.Rembourrage de problème

J'ai essayé d'ajouter un peu de marge autour de la case à cocher androïde pour laisser de la place, mais aucun rembourrage n'est fourni. J'ai aussi essayé android: paddingLeft/Right/etc. Comment puis-je avoir du remplissage autour de ma case à cocher?

Note: J'ai un LinearLayout intérieur parce que je vais ajouter plus TextViews

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="?android:attr/listPreferredItemHeight"> 
    <CheckBox 
     android:id="@+id/mycheck" 
     android:text="" 
     android:layout_width="30dip" 
     android:layout_height="wrap_content" 
     android:gravity="center_vertical" 
     android:focusable="false" 
     android:background="@drawable/checkbox_background" 
     android:button="@drawable/checkbox" 
    /> 
    <LinearLayout 
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_weight="1" 
     android:layout_height="wrap_content"> 
     <TextView 
      android:id="@+id/mytext" 
      android:layout_width="fill_parent" 
      android:layout_weight="1" 
      android:gravity="center_vertical" 
      android:layout_height="wrap_content" 
      android:lines="1" 
      android:textColor="@color/white" 
      android:textSize="10sp" 
      android:textStyle="italic" 
     /> 
    </LinearLayout> 
</LinearLayout> 

Répondre

1

Essayez de régler layout_marginLeft propriété de la deuxième mise en page

+0

qui fonctionne. Je vous remercie – Andrew