android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
めもめも。width が 0 !
こんな感じで使う
- <LinearLayout
- android:orientation="horizontal"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- >
- <Button
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="Left"
- android:layout_marginTop="5dip"
- />
- <Button
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="Right"
- android:layout_marginTop="5dip"
- />
- </LinearLayout>
layout_weight を使うケースとしては
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
をよく使ってたので、試しに並べてみました。

、、、同じですね。
fill_parent にしたくない場合
(そういえば API 8 からは match_parent が推奨なんだった)
にはいいのかもね
0 件のコメント:
コメントを投稿