Как правильно повернуть AlertDialog?Android

Форум для тех, кто программирует под Android
Anonymous
Как правильно повернуть AlertDialog?

Сообщение Anonymous »

Я использую этот код:

Код: Выделить всё

@Override
protected void onResume() {
super.onResume();

AlertDialog d = new AlertDialog.Builder(this)
.setTitle("This is the Dialog Title")
.setMessage("This is the Test message")
.setPositiveButton("Positive Button", (dialog, which) -> {
dialog.dismiss();
})
.create();

rotateDialog(d);

d.show();
}

public static void rotateDialog(Dialog curDlg) {
Window window = curDlg.getWindow();
if (window != null) {
View decorView = window.getDecorView();
decorView.setRotation(-90);
}
}
До вращения диалоговое окно выглядит правильно. Но после поворота на Эмуляторе обрезается. (

Код: Выделить всё

DecorView
визуализируется с помощью LayoutInspector).
Изображение

Какой код следует использовать для правильного поворота AlertDialog?

Подробнее здесь: https://stackoverflow.com/questions/798 ... -correctly

Вернуться в «Android»