J'essaie d'afficher une conception d'interface utilisateur à deux volets. J'essaie d'ajouter deux fragments dans une disposition linéaire avec un poids. Cependant, la disposition linéaire semble ignorer le poids. Comment puis-je le corriger ?? MerciDeux fragments ne peuvent pas peser dans la disposition linéaire?
[Lien:] http://dl.dropbox.com/u/78582670/twopanes.png
ma mise en page:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<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">
</fragment>
<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">
</fragment>
</LinearLayout>
Solution:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<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">
</fragment>
<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">
</fragment>
</LinearLayout>
essayer de donner poids 2 et 8 respectivement – rajpara
essayer. Mais, pas je veux. En fait, je veux vraiment peser le premier fragment à 8. –
puis l'échanger, essayez et erreur mec. – rajpara