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 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记