秀小川 2013-03-01 03:10 采纳率: 88.9%
浏览 2193
已采纳

布局问题,布局类似于下面那张图片.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout 
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="7"
        android:baselineAligned="false">
        <LinerLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"><!-- 问题在这里-->

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:focusableInTouchMode="false"
                android:text="@string/Subdistrict"/>

            <ListView
                android:id="@+id/Subdistrict"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >     
            </ListView>   

        </LinerLayout>

        <LinerLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:focusableInTouchMode="false"
                android:text="@string/Building"
                android:textColor="#ffffff"/>
           <ListView
                android:id="@+id/Building"
                android:layout_width="match_parent"
                android:layout_height="match_parent">
           </ListView>
        </LinerLayout>

    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center" >

        <Button 
            android:id="@+id/BuildingSelectOk"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/OK"/>
        <Button 
            android:id="@+id/BuildingSelectCancel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/Cancel"/>
    </LinearLayout>
</LinearLayout>

CSDN移动问答

两个listview不显示

  • 写回答

2条回答

  • Jobernowl 2013-03-01 03:24
    关注
        <?xml version="1.0" encoding="utf-8"?>
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="#ffffff"
            android:orientation="horizontal" >
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:orientation="vertical" >
    
                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1" >
    
                    <ListView
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_margin="18dp"
                        android:background="@drawable/stroke_bg" >
                    </ListView>
                </LinearLayout>
    
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="button1" />
            </LinearLayout>
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:orientation="vertical" >
    
                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_weight="1" >
    
                    <ListView
                        android:layout_width="fill_parent"
                        android:layout_height="fill_parent"
                        android:layout_margin="18dp"
                        android:background="@drawable/stroke_bg" >
                    </ListView>
                </LinearLayout>
    
                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="button2" />
            </LinearLayout>
    
        </LinearLayout>
    
    <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle" >
        <solid android:color="#00000000"/>
        <stroke
            android:width="1dp"
            android:color="#7F9DB9" />
    
    </shape>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 iqoo11 如何下载安装工程模式
  • ¥15 本题的答案是不是有问题
  • ¥15 关于#r语言#的问题:(svydesign)为什么在一个大的数据集中抽取了一个小数据集
  • ¥15 C++使用Gunplot
  • ¥15 这个电路是如何实现路灯控制器的,原理是什么,怎么求解灯亮起后熄灭的时间如图?
  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 蓝桥杯单片机第十三届第一场,整点继电器吸合,5s后断开出现了问题
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?