【发布时间】:2013-09-24 16:03:28
【问题描述】:
关注What does android:layout_weight mean?
我有这个:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<Button
android:id="@+id/buttonToastSimple"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="English Toast" />
<Button
android:id="@+id/buttonToastFancy"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:text="French Toast" />
</LinearLayout>
链接告诉我 buttonToastFancy 将占据四分之三的大小 (3/(3+1),但反过来说。根据 Eclipse/我的 AVD,buttonToastSimple 占据四分之三的屏幕大小。
我做错了什么?
【问题讨论】:
标签: android-layout