이것은 Xamarin과 VS 2015 커뮤니티의 Android 프로젝트입니다. XML에서는 표준 선형 레이아웃이 있고 두 개의 버튼이있는 상대적 레이아웃이 있습니다.'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'라는 문자가 있습니다. 그 위에 마우스를 올리면 " 'http://schemas.android.com/apk/res/android:layout_bellow'속성이 선언되지 않습니다. 2. 화면의 중앙에있는 버튼을 배치하기 위해 상대 레이아웃을 사용하려고합니다. (1) 및 내가 할 수있는 방법 (2)?
왜 RelativeLayout은 LinearLayout 안에 중첩되어 있습니까? 중첩 레이아웃은 퍼포먼스에 좋지 않습니다. –
그게 내가 (레이아웃 초보자) 이해하는 방법입니다. 다른 해결책을 제안하십시오. 버튼을 한 줄에 넣고 화면 중앙에 배치하려면 어떻게해야합니까? –
LinearLayout은 불필요하므로 제거하십시오. 중앙 버튼을 놓고 다른 두 버튼을 놓습니다. 하나는 왼쪽에 있고 다른 하나는 오른쪽에 있습니다. –