1 つの画像を持つ 1 つのカスタム アラート ダイアログを作成しています。私が直面している問題は次のとおりです。
1) 画面が小さいデバイスの場合、この警告ダイアログ ボックスが大きすぎるように見えます。aletdialog ボタンが画面の外に出ています (正と負のボタン)。
2) アラート ダイアログが 2 回描画されます。つまり、上下に 2 つの警告ダイアログがあり、両方を閉じるには、正のボタンを 2 回クリックする必要があります。
alertdialog のコードは次のとおりです。
AlertDialog.Builder alertdialog = new AlertDialog.Builder(
Activity.this);
alertdialog.setTitle("Title ");
alertdialog.setMessage("The MEssage ");
LayoutInflater layoutinf= LayoutInflater.from(Activity.this);
final View view = layoutinf.inflate(R.layout.layoutfile, null);
alertdialog.setView(view);
alertdialog.setPositiveButton("Button1",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
//do something
}
});
alertdialog.show();
どんな指針も役に立ちます。
ありがとう