Fala Gustavo,
When you use Relativelayout, you must specify which item is on top of which, for example:
<TextView
android:id="@+id/name_dias"
android:text="Leonardo Dias"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/name_rotondo"
android:text="Gustavo Rotondo"
android:layout_below="@id/name_dias"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
I have two Textview, and Gustado Rotondo, will be below Leonardo Dias.
And so you control, there are other options too:
- android:layout_toRightOf="@id/name_days" (left)
- android:layout_toLeftOf="@id/name_days" (right)
- android:layout_above="@id/name_days" (above)
And you can also use Linearlayout, when you define it, obligatorily you must specify a orientation, vertical or horizontal, and the items themselves will fit:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
Thus, all items will fit one below the other.
I hope I’ve been able to explain it better.
Hugs.
Don’t even think about using absolute layout. With 500 thousand xinglings phones of various screen patterns? And many of them do not follow patterns? Meet Framelayout and be happy :-)
– Mateus