Android landscape mode looks bad

187 Views Asked by At

My user interface looks like that in landscape mode:

enter image description here

But I want to have them in parallel. so the should have width / 2 instead of height/ 2. So how can I change that?

My code looks like that:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ffffff">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <Button
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/photo"
            android:layout_weight="0.5"
            android:id="@+id/btnTakePhoto" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/video"
            android:layout_weight="0.5"
            android:id="@+id/btnRecordVideo"
            />

    </LinearLayout>
</FrameLayout>

Thanks in advance for your help!

1

There are 1 best solutions below

0
Deepank Dwivedi On

Add layout-land folder in your res folder in app directory and design xml's with same name in this folder . Android frameworks will detects the mode and will select the layout file defined within layout-land folder .

*remember xml file name in layout and layout-land folder should be same .