android设置layout的时候为什么大小颠倒了啊

找到组织 发布于 2013/01/25 19:32
阅读 280
收藏 0

我最后两个layout明明设置的是3:2但是到手机上显示的时候成了2:3了,求教。下面是我的布局文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <EditText
        android:id="@+id/patterh"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="20dp"
        android:inputType="text" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="20dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="0dp"
        android:orientation="horizontal" >

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

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

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

        <Button
            android:id="@+id/ma"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/m1" />

        <Button
            android:id="@+id/mj"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/m2" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="20dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="0dp"
        android:orientation="horizontal" >

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

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

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

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

        <Button
            android:id="@+id/f22"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/f22" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="20dp"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:layout_marginTop="0dp"
        android:orientation="horizontal" >

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

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

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

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

        <Button
            android:id="@+id/f44"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/f44" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:baselineAligned="false"
        android:orientation="horizontal"
        android:weightSum="5" >

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

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:layout_marginLeft="20dp"
                android:layout_marginTop="0dp"
                android:orientation="horizontal" >

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

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

                <Button
                    android:id="@+id/f1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/f1" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20dp"
                android:layout_marginLeft="20dp"
                android:layout_marginTop="0dp"
                android:orientation="horizontal" >

                <Button
                    android:id="@+id/f0"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/f0" />
            </LinearLayout>
           
           
        </LinearLayout>

        <LinearLayout
            android:layout_marginBottom="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginTop="0dp"
            android:layout_weight="3"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

            <Button
                android:id="@+id/f88"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:text="@string/f88" />
        </LinearLayout>
    </LinearLayout>

</LinearLayout>

 

加载中
返回顶部
顶部