2017-08-25 1 views
0

Comment puis-je ajouter des espaces entre les vues dans le groupe RelativeLayout?comment ajouter de l'espace entre les vues dans RelativeLayout

J'ai essayé d'ajouter un espace entre TextView et Button après l'alignement du TextView en haut de Button en utilisant Layout_marginBottom et paddingBottom mais non d'entre eux travaillaient.

Voici le code:

<TextView 
android:layout_height="wrap_content" 
android:layout_width="match_parent" 
android:text=" Drawing ... " 
android:gravity="center_horizontal" 
android:layout_alignTop="@id/reset" 
android:layout_marginBottom="50dp" /> 

<Button 
    android:id="@+id/reset" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:onClick="reset" 
    android:text="Reset" /> 

Merci.

Répondre

1

Essayez ceci.

<TextView 
    android:layout_height="wrap_content" 
    android:layout_width="match_parent" 
    android:text=" Drawing ... " 
    android:gravity="center_horizontal" 
    android:layout_above="@+id/reset" 
    android:layout_marginBottom="15dp"/> 

<Button 
    android:id="@+id/reset" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:onClick="reset" 
    android:text="Reset" 
    android:layout_alignParentBottom="true"/>