Dialog box without title

I need to remove the title in the dialog. Notice I do not need an empty header. I need to delete the header section. The following is my code:

final Dialog dialog1=new Dialog(context); dialog1.setContentView(R.layout.redeemvoucher_first); dialog1.setCanceledOnTouchOutside(true); dialog1.getWindow().setLayout(900,500); dialog1.show(); 
+4
source share
3 answers

try this when creating a dialog

 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
+6
source

Before calling setContentView add this to remove the header:

 dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
+3
source

Try replacing:

 Dialog dialog1=new Dialog(context) 

with:

 Dialog dialog1=new Dialog(context, android.R.style.Theme_NoTitleBar); 
+1
source

Source: https://habr.com/ru/post/1434012/


All Articles