나는 아주 간단한 것을하고 싶습니다. 상단에 회 전자가있는 레이아웃이 필요하고, 목록보기가 뒤따라오고, 맨 아래에는 선형 버튼이 몇 개 배치되어 있습니다. 윈도우가 얼마나 큰 지 상관없이리스트 뷰가 스피너와 버튼 사이의 공간을 채우기 위해 확장되기를 원합니다. 나는이 세 가지 요소를 래핑하는 선형 레이아웃으로 시도하고 Layout_Height에 대해 Wrap Content 및 Fill Parent의 모든 조합을 시도했지만 목록보기 Layout_Height를 하드 코딩하지 않으면 300 개의 딥이 표시되고 단추는 밀려납니다. 화면에서. 나는 이것을 할 수있는 쉬운 방법이 있어야한다는 것을 압니다. 그러나 나는 지혜로 끝납니다. 나는 내가 생각할 수있는 모든 것을 시도했다.간단한 Android 레이아웃 문제
다음은 하드 코딩 된 높이로 작동하는 코드입니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<Spinner
android:id="@+id/fileType"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView
android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="300dip" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="bottom"
android:gravity="bottom"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/ManageFiles_DeleteItem"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_margin="5dip"
android:layout_weight="1"
android:text="Delete item" />
<Button
android:id="@+id/ManageFiles_DeleteAll"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_margin="5dip"
android:layout_weight="1"
android:text="Delete all" />
<Button
android:id="@+id/ManageFiles_DisplayItem"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_margin="5dip"
android:layout_weight="1"
android:text="Display item" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/ManageFiles_OKcustom"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_margin="10dip"
android:layout_weight="1"
android:text="OK" />
<Button
android:id="@+id/ManageFiles_CancelCustom"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_margin="10dip"
android:layout_weight="1"
android:text="Cancel" />
</LinearLayout>
</LinearLayout>
`
어떤 장치의 총 높이이며 프레임 워크의 어떤 종류의 당신이 생각하고, –
@Arju의 LinearLayout, 각 회 전자, 목록보기 무엇 높이를 필요합니까? Android 기기를 정말로 생각하십니까? –