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 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘