子片段未在父片段上正确显示

时间:2015-06-29 06:17:20

标签: android android-fragments

我在我的活动中使用嵌套片段,我有三个片段A,B,C其中B和C是A的子片段。在片段A的布局中我想给片段B 60%和片段C 40%设备宽度。下面是片段A的布局:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" tools:context="com.printer.epos.rtpl.NewOrderFragment"
android:weightSum="1"
android:background="@color/gray_background_color"
android:paddingRight="8dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="8dp"
android:baselineAligned="false"
android:orientation="horizontal">

<LinearLayout
    android:layout_width="0dp"
    android:id="@+id/bFragment"
    android:layout_height="match_parent"
    android:layout_weight=".6"
    android:orientation="horizontal"
     />
<LinearLayout
    android:layout_width="0dp"
    android:id="@+id/cFragment"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:layout_weight=".4"/>

但是当我在我的设备上运行app时,片段B占40%,C占设备总宽度的60%。请帮我解决这个问题。

0 个答案:

没有答案
相关问题