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" >
    
    评论

报告相同问题?

悬赏问题

  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常