我的代码有问题:
<FrameLayout 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"
tools:context="com.example.java.app.changeback">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="30dp"
android:layout_marginLeft="10dp">
<ImageView
android:layout_width="150dp"
android:layout_height="250dp"
app:srcCompat="@drawable/who"
android:id="@+id/back_who"
android:layout_weight="1" />
<ImageView
android:layout_width="150dp"
android:layout_height="250dp"
app:srcCompat="@drawable/grass"
android:id="@+id/back_grass"
android:layout_weight="1" />
<ImageView
android:layout_width="150dp"
android:layout_height="250dp"
app:srcCompat="@drawable/home"
android:id="@+id/back_home"
android:layout_weight="1" />
<ImageView
android:layout_width="150dp"
android:layout_height="250dp"
app:srcCompat="@drawable/green"
android:id="@+id/back_green"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<TextView
android:text="Home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="50dp"
android:layout_marginLeft="130dp"
android:layout_marginTop="30dp"
android:id="@+id/change_text" />
</LinearLayout>
</FrameLayout>
我检查过图像的名称没有错误。 这是照片文件夹的图片
运行程序时,它会退出。