私のプロジェクトでは、AlertDialog の代わりにカスタム ダイアログを使用する必要があります。しかし、Dialog スタイルには 2 つの問題があります。
- 幅が狭すぎる
- タイトルスペースを削除できません
だから、私は必要です
しかし、得る:
呼び出しコード:
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.write_message);
dialog.show();
レイアウト XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:minLines="3" >
<requestFocus />
</EditText>
<Button
android:id="@+id/send_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/send_message" />
</LinearLayout>
この問題を解決するにはどうすればよいですか? 助けてください。