【发布时间】:2013-05-16 14:18:38
【问题描述】:
如何使垂直线性布局始终可滚动,即使我的布局中只有一个 TextView?
- 当我向上滚动时,我希望它滚动并在底部显示一个空白区域。
- 当我向下滚动时,我希望它在我的视图顶部显示一个空白。
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/addCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scrollable view"/>
</LinearLayout>
</ScrollView>
【问题讨论】:
-
也许这可以给你一些提示stackoverflow.com/questions/14747525/…。但正如开发人员表中所说,不要尝试实现另一个操作系统 UI
标签: android layout scrollable