0
이것은 내가 만든 XML 파일입니다. LinearLayout
의 높이를 설정할 수 없습니다. 나는 수평으로 LinearLayout
의 방향을 설정했고 layout_weight
을 사용하여 LinearLayout
의 높이를 설정했습니다.android app의 중첩 된 레이아웃이 작동하지 않습니다.
그러나 으로 TextView
의 높이를 설정하면 작동하지 않습니다.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
tools:context=".MainActivity"
android:weightSum="3">
<LinearLayout
android:id="@+id/a"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="1"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="2"/>
</LinearLayout>
<LinearLayout
android:id="@+id/b"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:layout_below="@id/a">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="3"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="4"/>
</LinearLayout>
<LinearLayout
android:id="@+id/c"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:layout_below="@id/b">
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="5"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="6"/>
</LinearLayout>
</RelativeLayout>
"작동하지 않음"과 "작동하지 않음"은 무엇을 의미합니까? – Chris