다음은 제 코드입니다. 한 줄의 텍스트 상자, 아래에 2 개의 단추가있는 여러 줄의 텍스트 상자가있는 인터페이스가 필요합니다. 여러 줄의 텍스트 상자가 버튼과 텍스트 상자를 렌더링 한 후에 사용 가능한 모든 공간을 차지하기를 원합니다. 이를 위해 기본 레이아웃 내부에 두 개의 LinearLayouts를 만들었습니다. 첫 번째 레이아웃에는 layout_width가 fill_parent로 설정된 세로 방향이 있습니다. 두 번째 것은 fill_parent와 함께 다시 수평입니다.Android - 선형 배치 배열, 예상대로 위치 지정하지 않음
첫 번째 텍스트 상자에는 parent를 채우기 위해 layout_height가 설정되어 있습니다. 두 번째 텍스트 상자에는 OK와 Cancel이라는 두 개의 텍스트 상자가 있습니다.
이 응용 프로그램을 실행할 때 UI가 표시되지만 버튼은 매우 작습니다 (약 5px 높이). 버튼 높이를 수동으로 설정해야합니다. 내가 여기서 잘못하고있는 것은 무엇인가. 나는 버튼 높이를 하드 코딩하고 싶지 않다.
감사
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name"></TextView>
<EditText android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Contents"></TextView>
<EditText android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top" />
</LinearLayout>
<LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1">
<Button android:id="@+id/okbutt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="OK" android:layout_weight="1" />
<Button android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="Cancel" android:layout_weight="1" />
</LinearLayout>
, 아룬
감사합니다. svdree, 해결책이 작동합니다. 왜 내 것이 아닌지 궁금해. – Arun