나는 AlertDialog를 팽창 시켜서 사용자가 의견을 보낼 수있게했다. 아주 간단합니다. 반대 순서로 배치-V14/chat_comment_dialog.xml 파일 만들기 : 왼쪽에 있어야 취소 버튼을 (대화 상자의 버튼 순서
레이아웃> = 14 API에 대한 잘못된 버튼 순서를 사용하지만이 린트 경고를 받고 있어요)
그래, 좋아,이 솔루션은, API> = (14)에 대한 특정 레이아웃을 생성하고 순서를 반전 | "@ 문자열/ 전송 취소"이어야 | "취소 @ 문자열/보내기"이었다 . 하지만 정말? 이것은 정말로 공식적인 제안입니까? 일부 기기에서 한 주문을 설정하고 다른 주문에서 다른 주문을 설정 하시겠습니까? 사용자로서 나는 매우 혼란스러워 할 것입니다. 내가 가진, 그런데
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp" >
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/username"
android:singleLine="true" />
<EditText
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="180dp"
android:gravity="top|left"
android:hint="@string/review" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingRight="4dp"
android:text="@string/send"
android:textSize="18sp" />
<Button
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingLeft="4dp"
android:text="@android:string/cancel"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
:이 린트 조언을 무시하거나 경우, (I 오히려 혼란 생각) 장치 세트에 대한 새로운 패턴 어쨌든
에 따라, 여기에 레이아웃입니다 AlertDialog.Builder가 아닌 XML에서 버튼을 부 풀릴 수 있습니다 (어쩌면 이런 식으로 단추가 자동으로 순서가 지정됩니다). 왜냐하면 당신이 빌더의 비누 버튼으로 설정 한 모든 onClickListener가 대화 상자를 무시할 것이기 때문입니다. 직접 대화 상자를 제어하십시오.
예, 그렇습니다. 마지 못해 따를 수는 있지만 따라야 만합니다. 분명히 별도의 확인/취소 레이아웃 (2 가지 버전)과을 사방에 배치 할 수 있습니다. –
"하지만 .... 정말로? 이건 정말 공식적인 제안입니까?" 예, 그것입니다 =/그들은 API 레벨에서 Dialogs의 버튼의 기본 순서를 변경했습니다. xml 레이아웃 대신 빌더를 사용하여 대화 상자를 작성하면이 변경 사항도 표시됩니다. 그것이 좋은 생각인지는 논쟁의 여지가 있지만, 그럼에도 불구하고 그들은 그것으로 도망 가기로 결정했습니다. – FoamyGuy