【问题标题】:How to scroll content?如何滚动内容?
【发布时间】:2013-07-20 19:52:44
【问题描述】:
我有以下问题:
我需要 18 个按钮,旁边有一个 TextView,顶部有一个 TextView。当然,它们不适合显示器,所以我搜索了这个问题并找到了 ListView 但这对我不起作用,因为我需要 18 个具有不同 ID 的 Buttons 和 TextViews。
我希望你能帮助我。
【问题讨论】:
标签:
android
textview
android-button
android-scrollview
【解决方案1】:
使用 <ScrollView> 注意 <ScrollView> 只有一个直系子女
所以它必须像 :
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- your contents are here -->
</LinearLayout>
</ScrollView>