0

I have a screen that current has 3 buttons within a Linear Layout that is vertically orientated. I'm trying to have it so when I change the orientation of the devices screen it will still displaying neatly but I am not sure how. This is my current xml file.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/title_color"
    tools:context=".MainActivity">

    <Button
        android:id="@+id/Occupied"
        android:layout_width="235dp"
        android:layout_height="80dp"
        android:layout_marginStart="98dp"
        android:layout_marginLeft="98dp"
        android:layout_marginTop="186dp"
        android:background="@drawable/my_button_bg"
        android:text="@string/main_name_button"
        android:textAllCaps="false"
        android:textColor="#00FFFF"
        android:textSize="25sp" />

    <Button
        android:id="@+id/Guest"
        android:layout_width="235dp"
        android:layout_height="80dp"
        android:layout_marginStart="98dp"
        android:textAllCaps="false"
        android:layout_marginLeft="98dp"
        android:layout_marginTop="21dp"
        android:background="@drawable/my_button_bg"
        android:text="@string/main_play_button"
        android:textColor="#00FFFF"
        android:textSize="25sp" />

    <Button
        android:id="@+id/Room"
        android:layout_width="235dp"
        android:layout_height="80dp"
        android:layout_marginTop="33dp"
        android:textAllCaps="false"
        android:layout_marginStart="98dp"
        android:layout_marginLeft="98dp"
        android:background="@drawable/my_button_bg"
        android:text="@string/main_hands_button"
        android:textColor="#00FFFF"
        android:textSize="25sp" />

</LinearLayout>

1 Answers1

0

Have you tried adding this to your activity’s manifest?

android:configChanges="orientation|screenSize"/>