Я создал пользовательский alerttdialog с помощью следующего кода:
AlertDialog.Builder builder;
AlertDialog alertDialog;
LayoutInflater inflater = (LayoutInflater)ActivityName.this.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custom_layout,(ViewGroup)findViewById(R.id.layout_root));
builder = new AlertDialog.Builder(getParent());
builder.setView(layout);
alertDialog = builder.create();
alertDialog.show();
Проблема в том, что всплывающее окно окружено фоном диалога по умолчанию с собственным пустым пространством заголовка (так как заголовок не установлен).Как мне это убрать.Я пытался поставить пользовательский стиль через ContextThemeWrapper
, как builder = new AlertDialog.Builder(new ContextThemeWrapper(getParent(), R.style.CustomDialogTheme));
, но он не работает.Как я могу это сделать?!!!Заранее спасибо.Пользовательский стиль XML приведен ниже:
<style name="CustomDialogTheme" parent="android:style/Theme.Dialog.Alert">
<item name="android:windowIsFloating">false</item>
<item name="android:windowNoTitle">true</item>
</style>
![This is the output on the emulator](https://i.stack.imgur.com/VlUu4.png)