How to handle different Android screen sizes

Me_zyMe_zy USMember ✭✭

I do not know where to start. I started customizing my app to a 4.5 inch display. But now I have to state that some layouts such as that of a ListView are shown shortened on larger displays.

I also need an adaptation to the sizes 4.7 -6.0 inches.

What can I do to display different layouts on different screen sizes?

Best Answers

Answers

  • Me_zyMe_zy USMember ✭✭

    What I tried,

    put this in manifest:

    <supports-screens   android:resizeable="true"
                    android:smallScreens="true"
                    android:normalScreens="true"
                    android:largeScreens="true"/>
    

    Added to my project tree this folders:

    layout-large
    layout-small
    layout-normal
    layout-xlarge

    and

    layout-sw600dp
    layout-sw700dp

    that all does not help

  • Me_zyMe_zy USMember ✭✭
    edited November 8

    This is a part of a .axml

    I use some fix values

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="547.5dp"
        android:id="@+id/lin1">
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="128.5dp"
            android:id="@+id/lin2">
            <LinearLayout
                android:orientation="vertical"
                android:layout_width="159.0dp"
                android:layout_height="match_parent"
                android:id="@+id/lin3">
                <ImageButton
                    android:background="@android:color/background_light"
                    android:src="@drawable/ic_"
                    android:layout_width="51.0dp"
                    android:layout_height="50.5dp"
                    android:id="@+id/Bu1"
                    android:layout_marginTop="42.0dp"
                    android:layout_marginLeft="64.0dp" />
                <TextView
                    android:textColor="@android:color/black"
                    android:text="Dat"
                    android:layout_width="112.0dp"
                    android:layout_height="wrap_content"
                    android:id="@+id/syncText"
                    android:layout_marginLeft="40.0dp"
                    android:layout_marginRight="0.0dp" />
            </LinearLayout>
    

    Thats how all my layout sites look like

  • Me_zyMe_zy USMember ✭✭

    Yes, thats it. Thanks guys.

Sign In or Register to comment.