ScrollView中的LinearLayout本来是能正常显示的,但是在添加了第18行语句:
android:layout_marginTop="20dp"
之后,上面多出来了20dp的边距,这是对的。
但是为什么下边却少了20dp呢? 导致滚动条拖不到最低端,所以最下面的按钮显示不全。这是怎么回事?xml代码如下:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" > <ScrollView
android:layout_width="200dp"
android:layout_height="200dp"
android:scrollbars="vertical"
android:background="@android:color/background_dark" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="@android:color/holo_blue_light" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一步" />
<Button
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一步" />
<Button
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一步" />
<Button
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="下一步" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货