clcurie_11 2013-05-07 08:03 采纳率: 6.7%
浏览 3423

XML布局-添加scrollview后button就已经看不见了

我设置了如下的 XML布局,有一个TExt view和很多的check boxes和一个button。我在一个 Linear Layout 上附加上所有的check boxes,还设置了一个滚动视图。但是添加scrollview后button就已经看不见了,如何修改呢?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <TextView />
    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:orientation="vertical" >
        <LinearLayout>
            <CheckBox />
            <CheckBox />
            <CheckBox/>
            <CheckBox/>
            <CheckBox/>
            <CheckBox/>
            <CheckBox/>
            <CheckBox/>
            <CheckBox />
            <CheckBox/>
            <CheckBox />
        </LinearLayout>
    </ScrollView>
    <Button
    </Button>
</LinearLayout>
  • 写回答

2条回答 默认 最新

  • balmy 2013-05-08 10:49
    关注

    把你的scrollview改一下,高度0dip,权重为1 试下,另外一个而布局文件中有两个“http://schemas.android.com/apk/res/android"” 会有错误吧

    <ScrollView
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="match_parent"
               **android:layout_height="0dip"
            android:layout_weight= "1"** 
            android:fillViewport="true"
            android:orientation="vertical" >
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#java#的问题,请各位专家解答!
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件