Android ScrollView无法滚动到底部

时间:2017-04-18 20:14:35

标签: android scrollview

这是我的布局的一部分:

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/scroll"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorGrey20"
        tools:context=".View.Activities.MainActivity">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="24dip"
                android:orientation="horizontal">

...

我的ScrollView没有滚动到底部

Screenshot

永远不会到达最后一个图标和说明。 我的布局会改变什么?

4 个答案:

答案 0 :(得分:2)

使用

android:layout_height="fill_parent"

而不是"wrap_content" 在你的ScrollView中

答案 1 :(得分:1)

在scrollview及其子视图上使用填充而不是边距,滚动将是正确的。

答案 2 :(得分:0)

试试这个:

<ScrollView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="2dp"
    android:id="@+id/scrollview"
    android:stackFromBottom="true"
    android:transcriptMode="alwaysScroll">

答案 3 :(得分:0)

替换我的成绩很好

here 0
here 1
here 2
here 3
here 4
here 5
here 6
here 7
here 8
here 9

finished...

...与此:

android:layout_height="wrap_content"

(我仍然无法理解根本原因。)

相关问题