カスタム ダイアログを作成しました。タイトルに AlertDialog のような背景を付けたいと思います。
より良い言い方:
「カスタムダイアログ」と書いてあるところ
次のような「ヘッダー」が必要です。
テキストに画像を追加するだけではなく、表示されている完全な UI スタイルを実際に実装します。
これは可能ですか?
カスタム ダイアログに使用したコードは次のとおりです。
カスタム ダイアログを作成しました。タイトルに AlertDialog のような背景を付けたいと思います。
より良い言い方:
「カスタムダイアログ」と書いてあるところ
次のような「ヘッダー」が必要です。
テキストに画像を追加するだけではなく、表示されている完全な UI スタイルを実際に実装します。
これは可能ですか?
カスタム ダイアログに使用したコードは次のとおりです。
Galipこれは私のために働いたコードです
Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.dialoglayout);
dialog.setTitle("Pick A Colour");
私のdialoglayoutには、ルート要素RadioGroupがありました
それが役に立てば幸い。
では、なぜクラシックを使用しないのAlertDialog.Builder
ですか?
AlertDialog.Builder builder = new AlertDialog.Builder( activity );
builder.setTitle( title );
builder.setView( /* Your custom view here */ );
// optional
builder.setPositiveButton( R.string.button_ok, listener );
builder.setNegativeButton( R.string.button_cancel, listener );
AlertDialog alert = builder.create();
alert.show();
これで、システム ダイアログのルック アンド フィールが得られます。