【发布时间】:2016-07-25 22:58:49
【问题描述】:
我的 ScrollView 有问题。我想把它放在可用的空间里,但我不知道怎么做。
现在我在一个 LinearLayout 之前有我的 ScrollView 和我的 TextView:
<ScrollView
android:id="@+id/scrollView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fillViewport="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/previousimage"
android:layout_marginTop="@dimen/margin">
<TextView
android:id="@+id/question_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margintop"
android:gravity="center_horizontal"
android:paddingBottom="@dimen/margin_five"
android:scrollbars="vertical"
android:textColor="@color/white"
android:textSize="@dimen/common_textsize" />
</ScrollView>
<LinearLayout
android:id="@+id/bottom_options"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/scrollView"
android:layout_marginTop="@dimen/margin_small"
android:gravity="center|bottom"
android:orientation="vertical">
问题是,如果我的 TextView 中有这么多文本,LinearLayout 会下降并隐藏。我想滚动里面的文本。无需下推 LinearLayout。
我想为 ScrollView 自动占用这个空间以适应所有屏幕尺寸。
谢谢!
【问题讨论】:
-
我觉得你的线性布局在这里没用。
标签: android android-layout layout