我有以下布局:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="horizontal"
android:weightSum="2">
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="ch.lexs.view.LawList"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
</fragment>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:name="ch.lexs.view.ParagraphList"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1">
</fragment>
</LinearLayout>
我的 Intent 是将 LinearLayout 分成两个大小完全相同的部分。我认为这可以通过使用重量来完成。但是第二个 fragment 要小得多。我做错了什么?
最佳答案
尝试将两者的宽度设置为“fill_parent”。
关于Android:如何将LinearLayout分成大小完全相同的两部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5967727/