阿闷 2015-04-09 06:25 采纳率: 0%
浏览 1913
已采纳

线性布局问题 计算器布局

图片说明4/09/1428560451_585625.png)

为什么没有出现第一张效果,求解
代码如下:
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >

<LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal">

    <EditText 
        android:id="@+id/msg" android:layout_width="match_parent"
        android:layout_height="wrap_content" android:hint="@null" />
</LinearLayout>

<LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal">


    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="@+string/m_c"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="m+"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="m-"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="mr"
        android:layout_weight="1"></Button>
</LinearLayout>

<LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal">


    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="c"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="+/-"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="/*"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="*"
        android:layout_weight="1"></Button>
</LinearLayout>

 <LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal">


    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="7"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="8"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="9"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="-"
        android:layout_weight="1"></Button>
</LinearLayout>

 <LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal">


    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="4"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="5"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="6"
        android:layout_weight="1"></Button>

    <Button android:layout_width="match_parent"
        android:layout_height="wrap_content" android:text="+    "
        android:layout_weight="1"></Button>
</LinearLayout>

<LinearLayout android:layout_width="match_parent"
    android:layout_height="wrap_content" android:orientation="horizontal"
    android:layout_weight="0">

        <LinearLayout android:layout_width="wrap_content"
             android:layout_height="wrap_content" android:orientation="vertical"
             > 

            <LinearLayout android:layout_width="match_parent"
                 android:layout_height="match_parent" android:orientation="horizontal">
                 <Button android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:text="0"></Button>
                 <Button android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:text="0"></Button>
                 <Button android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:text="0"></Button>
                 <Button android:layout_width="match_parent"
                    android:layout_height="wrap_content" android:layout_weight="1"
                    android:text="0"></Button>
            </LinearLayout>  



        </LinearLayout>             
</LinearLayout>  

  • 写回答

5条回答 默认 最新

  • 林茕夜 2015-04-09 07:46
    关注

    图片说明这个地方错了,改一下!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧
  • ¥15 #MATLAB仿真#车辆换道路径规划