I’m trying to put TextView, EdiText, and Button on 3 separate lines but they end up on the same line :
<TextView android:id="@+id/lat_label"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/lat_label" />
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send"
android:onClick="sendMessage" />
I just started android, what do I do ?
Put
LinearLayoutas a parent to these three view and setandroid:orientation="vertical"to thatLinearLayout. That’s it. Simple 🙂Try this..