ほとんどのAndroid開発者が人生を費やしているのを私が見ることができるものの1つはレイアウトです。
私がRelativeLayoutsでやりたいことを実行できるようですが、少なくとも2の倍数に対してのみです。少なくともこれまでに見つけたものです。ボタンの中央では、2つのボタンが同じ行に配置され、それぞれが画面の約半分を占めます。ボタンの中央がないと、それらは互いに重なります。それは価値があるのだろうか。
これがお役に立てば幸いです。
<View android:id="@+id/button_center" android:layout_width="0dp"
android:layout_height="0dp" android:layout_centerHorizontal="true" />
<Button android:id="@+id/btnButton1" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Button 1"
android:layout_toLeftOf="@+id/button_center"/>
<Button android:id="@+id/btnButton2" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="Button 2"
android:layout_toRightOf="@+id/button_center" />