고객 정보를 얻으려는 활동이 있습니다. 첫 번째 줄에는 이름, 두 번째 줄 주소, 세 번째 줄은 도시, 주 및 우편 번호입니다. RelativeLayout을 사용하고 android : layout_below 및 android : layout_toRightOf를 사용하여 원하는 것을 얻을 수 있습니다. 그런 다음 내보기의 너비를 구체적으로 지정해야합니다. 사용자가 새로운 버전의 안드로이드 버전을 재배치하거나 전환 할 때 그 너비가 이상하게 보일 수 있습니다. LinearLayout의 가중치 기능을 활용하길 원하지만 모든 것이 한 줄에 모두 표시됩니다. LinearLayout 내에 뷰의 행을 만들기 위해 어떻게 라인 브레이크를 삽입하나요?Android LinearLayout XML의 줄 바꿈
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/custLabel"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:layout_width="0dip"
android:text="Name"/>
<EditText
android:id="@+id/customer"
android:layout_height="wrap_content"
android:layout_weight=".75"
android:layout_width="0dip"/>
<TextView
android:id="@+id/addressLabel"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:layout_width="0dip"
android:text="Address"/>
<EditText
android:id="@+id/address"
android:layout_height="wrap_content"
android:layout_weight=".75"
android:layout_width="0dip"/>
<TextView
android:id="@+id/cityLabel"
android:layout_height="wrap_content"
android:layout_weight=".1"
android:layout_width="0dip"
android:text="City"/>
<EditText
android:id="@+id/city"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:layout_width="0dip"/>
<TextView
android:id="@+id/stateLabel"
android:layout_height="wrap_content"
android:layout_weight=".1"
android:layout_width="0dip"
android:text="State"/>
<EditText
android:id="@+id/state"
android:layout_height="wrap_content"
android:layout_weight=".20"
android:layout_width="0dip"/>
<TextView
android:id="@+id/zipLabel"
android:layout_height="wrap_content"
android:layout_weight=".1"
android:layout_width="0dip"
android:text="Zip"/>
<EditText
android:id="@+id/zip"
android:layout_height="wrap_content"
android:layout_weight=".25"
android:layout_width="0dip"/>
</LinearLayout>
그건 작동합니다. 더 간단한 방법이 없다는 것을 믿을 수 없습니다. 감사! – jmease