Android platform for Nexus4 vs Nexus 7

I am browsing my Android app in Nexus 4 :). Here

enter image description here

But when I try to view it on a Nexus 7 emulator ,: (

enter image description here

I think I have problems with multi-screen support in my game. My question is: how can I make it look bigger on Nexus 7 or 10 or on any other devices?

By the way, I placed my images (board.png, small_hole.png, big_hole.png and bg.png) in the drawable-xhdpi folder (I use Android Studio)

Do you think I used the wrong layout or properties in my XML file? Is there something wrong in my code?

This is my xml layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg.png>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/board"
        android:orientation="horizontal" >

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="20dp" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/big_hole" >
            </ImageView>
        </FrameLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_gravity="center_vertical">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginBottom="2dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/small_hole" >
                </ImageView>

                // paste 6 more ImageViews here

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_marginTop="7dp">

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/small_hole" >
                </ImageView>

               // paste 6 more ImageViews here

            </LinearLayout>

        </LinearLayout>

        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginRight="20dp" >

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="fitCenter"
                android:background="@drawable/big_hole" >
            </ImageView>

        </FrameLayout>

    </LinearLayout>

</RelativeLayout>

Thank you guys ..

+4
source share
2 answers

drawable-xhdpi Nexus 4

Nexus 7 drawable-large-tvdpi drawable-sw600dp-tvdpi.

Nexus 10 drawable-xlarge-xhdpi drawable-sw720dp-xhdpi.

u ur u shud .

Nexus 4 4,7 (768 * 1280), Nexus 7 - 7 (800 * 1280).

:

Android?

0

youre res/mdpi, , , (hdpi, xhdpi) ( , modyfiers - x1.5 x2 hdpi xhdpi).

, , .. layout-sw720dp .

0

All Articles