android 模拟器上的工作室屏幕尺寸不一样

android studio screen size not same on emulator

你好,我正在 android studio.my workbench 上制作项目 workbench 在模拟器上工作时屏幕尺寸不一样

in my phone when i trying

in android studio when i developing

我有一个 scroolview vertical ann 它在 scrollwiew.i 中有一个线性布局想对每个 phone.

我的menu.xml

 <ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/scrollView" >
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">


        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="chosse one!"
            android:id="@+id/textView2"
            android:layout_alignParentTop="true"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center_horizontal" />

        <ImageButton
            android:id="@+id/imageButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:background="@mipmap/love"
            android:layout_below="@+id/textView2"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <ImageButton
            android:id="@+id/imageButton2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:background="@mipmap/krm"
            android:layout_below="@+id/imageButton"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <ImageButton
            android:id="@+id/imageButton3"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:background="@mipmap/rak"
            android:layout_below="@+id/imageButton2"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <ImageButton
            android:id="@+id/imageButton4"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"

            android:background="@mipmap/rght"
            android:layout_below="@+id/imageButton3"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" />

        <ImageButton
            android:id="@+id/imageButton5"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@mipmap/left"
            android:layout_below="@+id/imageButton4"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
           />

    </LinearLayout>
</ScrollView>

发生这种情况是因为设备具有不同的密度和屏幕尺寸。您测试应用的设备屏幕密度较低 and/or 屏幕高度较小,因此它会压缩布局。 您可以多次设计相同的布局以使用多种密度,如 hdpi、xhdpi、mdpi 等。可以在此处找到更多信息:http://developer.android.com/guide/practices/screens_support.html