我如何可以使用这些复选框滚动视图 [英] How can I use scroll view on these checkboxes

查看:276
本文介绍了我如何可以使用这些复选框滚动视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约10复选框,或者我不能上去,要看看他们。我将如何使用滚动视图以查看他们在这里对复选框的XML。

I have about 10 check boxes and I can't go up or down to see all of them. How would I use scrollview to view them here's the xml for checkboxes.

`
    

<CheckBox
    android:id="@+id/CheckBox15"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />


<CheckBox
    android:id="@+id/CheckBox14"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >
    </LinearLayout>


<CheckBox
    android:id="@+id/CheckBox13"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />


<CheckBox
    android:id="@+id/CheckBox12"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />


<CheckBox
    android:id="@+id/CheckBox11"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />


<CheckBox
    android:id="@+id/CheckBox10"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="CheckBox" />

 </LinearLayout>

`
我想这个复选框列表,请帮助上使用滚动视图。

` I want to use scroll view on this checkbox list please helping.

推荐答案

一个滚动型只能包含一个单一的视图或布局,所以把你的LinearLayout的滚动型里面,然后把该复选框内的LinearLayout:

A ScrollView can only contain a single View or Layout, so put your LinearLayout inside the ScrollView, then put the checkboxes inside that LinearLayout:

<ScrollView>
<LinearLayout>
  <CheckBox />
  <CheckBox />
  <CheckBox />
  ....
</LinearLayout>
</ScrollView>

这篇关于我如何可以使用这些复选框滚动视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆