Заголовок не отображается во фрагменте диалога - PullRequest
0 голосов
/ 05 марта 2019

У меня есть следующий стиль, который должен отображать заголовок диалогового окна

<style name="CustomDialog" parent="@style/Theme.AppCompat.Light.Dialog">
    <item name="android:windowNoTitle">false</item>
</style>

Тем не менее, диалоговое окно не отображает заголовок. Диалог похож на изображение ниже Dialog With no title.Я также включил код, который я использую для инициализации представления

void initView(int maxLength)
{
    setStyle(DialogFragment.STYLE_NORMAL, R.style.CustomDialog);

    getDialog().setTitle(title);
    Window wnd = getDialog().getWindow();
    if (wnd != null)
        wnd.getAttributes().windowAnimations = R.style.dialog_animation;

    Button dismiss = root.findViewById(R.id.numeric_done);
    dismiss.setOnClickListener((View v) -> done());

    this.maxLength = maxLength;
    numericInputManager = new NumericInputManager(maxLength);

    intStack = new Stack<>();
    valueEnteredTV = root.findViewById(R.id.value_entered);

    initButtons();
    initRestrictions();
}
...