我有一个简单的布局如下:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D23456" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:background="#FFFFFF" >
<ImageView
android:layout_width="match_parent"
android:layout_height="800dp"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</ScrollView>
ScrollView 的背景为粉色,内部的线性布局中有 Android 图标图片,高度为 800dp(不适应屏幕)。我期望看到的是 ImageView 在粉色背景中浮动,并且四周都有 10dp 的边距(上、下、左、右)。但是当我滚动到底部时,ScrollView 没有滚动到边缘,因此滚动到底部后显示的是 ImageView 而非粉色边距。
如何解决这个问题?这会让用户认为页面还没有结束,想要继续滚动。
LinearLayout
。我正在使用RelativeLayout
。 - theblang