父亲是相对布局,然后是图像视图和滚动视图,在滚动视图中是另一个相对布局。在手机中测试时,它不会向下滚动。请帮忙……
您必须使用LinearLayout滚动视图以及wrap_content
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/MistyRose"> <ImageView android:id="@+id/reglogo" android:layout_width="200sp" android:layout_height="150sp" android:layout_centerHorizontal="true" android:layout_marginTop="30dp" android:background="@drawable/logo" /> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignBottom="@id/reglogo" android:layout_marginTop="180dp" android:layout_marginBottom="-551dp" android:fillViewport="true"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" />
您已将子RelativeLayout的高度设置为 match parent 。这意味着RelativeLayout与ScrollView具有相同的高度。因此,没有什么可以滚动,因为它们的高度相同!
match parent