【问题标题】:How to make Text views and Toggle buttons in a single scroll view in Android?如何在 Android 的单个滚动视图中制作文本视图和切换按钮?
【发布时间】:2014-12-06 14:55:43
【问题描述】:

我的程序中有 40 个切换按钮,我想为每个按钮添加 40 个文本视图。我需要让我的 TextView 和 Toggle 按钮可滚动。我该怎么做?有人可以帮帮我吗??

【问题讨论】:

    标签: android textview android-scrollview


    【解决方案1】:

    在您的 xml 中添加以下内容

    <?xml version="1.0" encoding="utf-8"?>
    <ScrollView
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
        <!-- Here you put the rest of your current view...Any layout can be placed within the scrollview and this will be scrollable-->
    
    </ScrollView>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-08
      • 1970-01-01
      • 1970-01-01
      • 2018-10-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多