Joyson
Joyson

Reputation: 1653

Dialog box without title

I need to delete the title in a dialog. Note i dont need a blank title.I need to delete the title section.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();

Upvotes: 4

Views: 1485

Answers (3)

Mohamed_AbdAllah
Mohamed_AbdAllah

Reputation: 5322

Try replacing:

Dialog dialog1=new Dialog(context)

with:

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

Upvotes: 1

Michael Celey
Michael Celey

Reputation: 12745

Before calling setContentView, add this to remove the title:

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

Upvotes: 3

Sankar
Sankar

Reputation: 1691

try this while creating dialog

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

Upvotes: 6

Related Questions