1.- Abrimos el main.xml
2.- Colocaremos 3 TextViews con un texto opcional, le colocaremos a cada uno un color de fondo distinto para diferenciarlos, usaremos una orientacion vertical y por ultimo usaremos el android:weight para poder ver este espaciado.
3.- A continuacion el codigo y el resultado de el espacio entre cada textview en nuestra ventana.
main.xml
<?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"
>
<TextView
android:text="Depredador1220"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#4CAF50"
android:textSize="60dp"
android:layout_weight="1"
/>
<TextView
android:text="Mario Bros"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2196F3"
android:textSize="60dp"
android:layout_weight="1"
/>
<TextView
android:text="Goku"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#673AB7"
android:textSize="60dp"
android:layout_weight="1"
/>
</LinearLayout>

No hay comentarios:
Publicar un comentario