Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo fragment can't weight in the Linear layout?
    primarykey
    data
    text
    <p>i try to display a two-pane UI design. I try to add two fragments in a linear layout with a weight. However, the linear layout seems to ignore the weight. How do i correct it?? Thanks</p> <p>[Link:] <a href="http://dl.dropbox.com/u/78582670/twopanes.png" rel="nofollow">http://dl.dropbox.com/u/78582670/twopanes.png</a></p> <p>my layout:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" &gt; &lt;fragment class="com.usci.view.fragment.CatalogFragment" android:id="@+id/fragment_catalog" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.2"&gt; &lt;/fragment&gt; &lt;fragment class="com.usci.education.TestFragment1" android:id="@+id/fragment_test" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_weight="0.8"&gt; &lt;/fragment&gt; &lt;/LinearLayout&gt; </code></pre> <p>Solution:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" &gt; &lt;fragment class="com.usci.view.fragment.CatalogFragment" android:id="@+id/fragment_catalog" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="8"&gt; &lt;/fragment&gt; &lt;fragment class="com.usci.education.TestFragment1" android:id="@+id/fragment_test" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="2"&gt; &lt;/fragment&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload