Android のドキュメントで、このおかしな重みの値についていつも読んでいます。今、初めて試してみたいのですが、まったく機能しません。
ドキュメントから理解しているように、このレイアウトは次のとおりです。
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:text="Register"
android:id="@+id/register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
weight="1" />
<Button
android:text="Not this time"
android:id="@+id/cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dip"
weight="1" />
</LinearLayout>
水平方向に配置され、スペースを均等に共有する 2 つのボタンを作成する必要があります。問題は、2 つのボタンがスペースを埋めるために大きくならないことです。
ボタンを大きくして行全体を埋めたいと思います。両方のボタンが親に一致するように設定されている場合、最初のボタンのみが表示され、行全体に表示されます。