IMO 사용자 지정 대화 상자를 만들려고하고 TableLayout을 사용하여 요소를 배치하려고합니다. 이렇게하면 단추를 넣을 수 있고 제목에 속성 stretchcolumn을 사용하여 화면의 측면에있는 단추를 누를 수 있습니다. (나는 당신을 잘 이해하는 경우)
alt text http://img801.imageshack.us/img801/4372/tablelayout.png
이 XML 예제와 함께 갈 경우, 작동 및 화면 크기/회전에서 독립적이어야한다 : 빠른 응답을위한
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:stretchColumns="1">
<TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content"
android:layout_height="wrap_content">
<Button android:text="Button01" android:id="@+id/Button01"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
<TextView android:text="This is your title" android:id="@+id/TextView01"
android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center_horizontal" ></TextView>
<Button android:text="Button02" android:id="@+id/Button02"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</TableRow>
</TableLayout>
감사 Sephy. 이것은 화면 크기를 보장 할 수 있다면 작동할까요? 마찬가지로, 알 수없는 해상도에서 오른쪽/왼쪽 버튼을 얼마나 멀리 밀어야할지 모르거나,이를 이해할 수없는 속성이 있습니다. 감사. – nitsujri
화면의 크기를 알아야한다고 생각하지 마십시오 ... 몇 가지 테스트를 수행하고 내 게시물을 편집 할 것입니다. – Sephy