這是我的看法片段如何更改Android中片段的重量大小?
<?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:orientation="horizontal"
android:weightSum="100"
>
<fragment
android:id="@+id/menuFragment"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_weight="70"
class="com.pack.Menufragment" >
</fragment>
<fragment
android:id="@+id/bodyFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="30"
class="com.pack.BodyFragment" >
</fragment>
</LinearLayout>
現在我想從Java不是從XML改變片段重量大小的XML的佈局,反正是有這樣做嗎?
我這樣做了,但它沒有顯示任何錯誤,但沒有影響大小 – 2012-03-28 07:43:27