【发布时间】:2013-01-26 11:44:31
【问题描述】:
我无法使 ScrollView 正确滚动。它总是切断底部的内容,就好像它是一个普通的LinearLayout一样。
我的代码
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout android:id="@+id/scroll_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isScrollContainer="true"
android:orientation="vertical" >
当然,我已经尝试添加/删除“fillViewport”和“isScrollContainer”属性,它并没有改变任何东西。
这适用于 ScrollView(仅限垂直)
HorizontalScrollView 必须用于水平滚动。
【问题讨论】:
-
能否请您粘贴完整的 xml,可能与您的 LinearLayout 有关。
-
尝试将
android:layout_height="match_parent"更改为android:layout_height="0dp"并在ScrollView上添加android:layout_weight = "1"。 -
刚刚试过,没有运气。
-
约束布局的用户,请看link
-
正如@SiddharthLele 建议的那样,将 layout_height 设置为 0dp 对我有用
标签: android scroll android-linearlayout android-scrollview