设计如下界面
将所需的图片和.xml文件复制到drawable文件夹
activity_main.xml中的代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/apple"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/yellow"
android:src="@drawable/apple">
</ImageView>
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableRow>
<Button
android:id="@+id/fitcenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="FITCENTER" />
<Button
android:id="@+id/centercrop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="CERTERCROP" />
<Button
android:id="@+id/centerinside"
android:layout_width="wrap_content"