Android上的全高清分辨率问题

时间:2014-03-13 12:34:18

标签: android resolution

我的Nexus5分辨率有问题。我正在编写一个应该适用于所有手机上所有分辨率的应用程序。在我的Galaxy Note 8上,一切正常,也适用于所有其他没有高清分辨率的设备。问题只出现在Nexus5和新的Nexus7上(均为全高清)。

有关如何解决问题的想法吗?

这是一个应该是什么样子的打印屏幕:

  

enter image description here

这是来自Nexus5的那个:

  

enter image description here

这是XML布局代码:

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:weightSum="1">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:id="@+id/header"
    android:layout_weight=".15">

</RelativeLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:id="@+id/body"
    android:layout_weight="0.70">

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:id="@+id/rows"
        android:weightSum="7">

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="UP"
            android:id="@+id/UPbutton"
            android:layout_weight="1" />

        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="5"
            android:id="@+id/columns"
            android:weightSum="7">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="LEFT"
                android:id="@+id/LEFTbutton3"
                android:layout_weight="1" />

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:id="@+id/column1">


                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW1"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW2"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW3"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW4"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW5"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
            </LinearLayout>

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:id="@+id/column2">
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW1"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW2"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW3"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW4"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW5"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                </LinearLayout>

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:id="@+id/column3">
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW1"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW2"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW3"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW4"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW5"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                </LinearLayout>

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:id="@+id/column4">
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW1"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW2"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW3"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW4"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW5"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                </LinearLayout>

            <LinearLayout
                android:orientation="vertical"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:id="@+id/column5">
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW1"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW2"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW3"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW4"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/imageViewROW5"
                    android:layout_weight="1"
                    android:src="@drawable/osnovna"
                    android:adjustViewBounds="true"
                    android:layout_margin="3dp" />
                </LinearLayout>

            <Button
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:text="RIGHT"
                android:id="@+id/RIGHTbutton4"
                android:layout_weight="1.5" />
        </LinearLayout>

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="DOWN"
            android:id="@+id/DOWNbutton2"
            android:layout_weight="1" />
    </LinearLayout>
</RelativeLayout>

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/footer"
    android:layout_weight="0.15"></RelativeLayout>

0 个答案:

没有答案