これはVS 2015 Community with XamarinのAndroidプロジェクトです。 XMLでは標準の線形レイアウトがあり、その内部には2つのボタンを持つ相対レイアウトがあります。'layout_bellow'属性が宣言されていません
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="25px"
android:minHeight="25px">
<RelativeLayout
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/relativeLayout1">
<Button
android:text="Button 1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button1" />
<Button
android:text="Button 2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/button2"
android:layout_bellow="@id/button1"
/>
</RelativeLayout>
</LinearLayout>
1:エディタに緑色の下線が付いています。「android:layout_bellow」です。 2.相対レイアウトを使用して、画面中央のボタンを配置しようとしています。 (1)、および私が行うことができますどのように(2)?
なぜあなたのRelativeLayoutはLinearLayoutの中にネストされていますか?レイアウトの入れ子は、パフォーマンスには悪いです。 –
それは私(レイアウトの初心者)がそれを理解する方法です。他の解決策を提案してください。どのようにボタンを1つの行に配置し、画面の中央に配置できますか? –
LinearLayoutは不要なので削除してください。センターボタンと他の2つのボタンを配置します。 1つはその左側に、もう1つは右側にあります。 –