$ avtivity main.xml
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/p"
android:orientation="vertical"
tools:context="com.example.nanda.myapplication.MainActivity">
<GridLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alignmentMode="alignMargins"
android:columnCount="2"
android:columnOrderPreserved="false"
android:padding="14dp"
android:rowCount="4"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="0dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView1"
android:layout_width="170dp"
android:layout_height="140dp"
android:layout_marginStart="5dp"
android:adjustViewBounds="true"
android:background="@drawable/white"
android:backgroundTint="@color/tblack"
android:contentDescription="@string/app_name"
android:cropToPadding="true"
/>
<ImageButton
android:id="@+id/MyButton1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:adjustViewBounds="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:cropToPadding="true"
android:elevation="0dp"
android:scaleType="fitCenter"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView1"
android:layout_alignStart="@+id/MyButton1"
android:layout_marginBottom="10dp"
android:layout_marginStart="50dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout>
<ImageView
android:id="@+id/imageView2"
android:layout_width="170dp"
android:layout_height="140dp"
android:layout_marginStart="5dp"
android:adjustViewBounds="false"
android:background="@drawable/white"
android:backgroundTint="@color/tblack"
android:contentDescription="@string/app_name"
android:cropToPadding="false" />
<ImageButton
android:id="@+id/MyButton2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView2"
android:layout_alignStart="@+id/MyButton2"
android:layout_marginStart="50dp"
android:layout_marginBottom="10dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout>
<ImageView
android:layout_width="170dp"
android:layout_height="140dp"
android:background="@drawable/white"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:contentDescription="@string/app_name"
android:backgroundTint="@color/tblack"
android:id="@+id/imageView3" />
<ImageButton
android:id="@+id/MyButton3"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView3"
android:layout_alignStart="@+id/MyButton3"
android:layout_marginStart="50dp"
android:layout_marginBottom="10dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout>
<ImageView
android:id="@+id/imageView4"
android:layout_width="170dp"
android:layout_height="140dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:background="@drawable/white"
android:backgroundTint="@color/tblack"
android:contentDescription="@string/app_name" />
<ImageButton
android:id="@+id/MyButton4"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView4"
android:layout_alignStart="@+id/MyButton4"
android:layout_marginStart="50dp"
android:layout_marginBottom="10dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout>
<ImageView
android:layout_width="170dp"
android:layout_height="140dp"
android:background="@drawable/white"
android:layout_marginStart="5dp"
android:contentDescription="@string/app_name"
android:backgroundTint="@color/tblack"
android:id="@+id/imageView5" />
<ImageButton
android:id="@+id/MyButton5"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView5"
android:layout_alignStart="@+id/MyButton5"
android:layout_marginStart="50dp"
android:layout_marginBottom="10dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout>
<ImageView
android:layout_width="170dp"
android:layout_height="140dp"
android:background="@drawable/white"
android:layout_marginStart="5dp"
android:contentDescription="@string/app_name"
android:backgroundTint="@color/tblack"
android:id="@+id/imageView6"
android:layout_below=""/>
<ImageButton
android:id="@+id/MyButton6"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginTop="40dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:background="@drawable/mo"
android:contentDescription="@string/button"
android:text="@string/button" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imageView6"
android:layout_alignStart="@+id/MyButton6"
android:layout_marginStart="50dp"
android:layout_marginBottom="10dp"
android:clickable="false"
android:text="@string/moddle"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
</GridLayout>
</RelativeLayout>
当我运行此应用时
它与一个模拟器不同, 在小尺寸屏幕上我的布局适合它,但是当我在大屏幕上运行它时,模拟器的布局正在移动到顶部, 我希望我的应用程序在大屏幕和小屏幕上看起来都一样 拜托,有人,帮助我 提前谢谢