2012-03-28 13 views
0

に変更していない私はここにXMLコードがあります。がレイアウト重量XML

<?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="horizontal" 
    android:weightSum="100" 

    > 
    <fragment 
     android:name="com.powergroup.split.view.powerListFragment" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:id="@+id/powerlist_fragment" 
     android:layout_weight="45" 

     > 
    </fragment> 
    <fragment 
     android:name="com.powergroup.split.view.powerViewerFragment" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:id="@+id/powerview_fragment" 
     android:layout_weight="55" 
     > 
    </fragment> 
</LinearLayout> 

をしかし、私はそれが何の効果を取り、常に同じを示しdoesntのlayout_weightの値を変更した場合、どのように私はそれを把握することができますか?

答えて

0

ウェイトをキックインするには、フラグメント 'layout_width0dpを設定する必要があります。以下を参照してください:

android:layout_width="0dp" 
+0

私はしましたが、変更は起こっていません。 –

+0

両方のフラグメントに設定しましたか? – waqaslam

0

* layout_weight *は "未使用"ピクセル分布にのみ適用可能です。すべてのフラグメントの幅は、fill_parentです。したがって、この場合、「未使用」ピクセルはありません。 layout_width = "0dip"に設定してください。

関連する問題