0

I am creating a dialog for which I don't need a title area so I just disable it inside onCreateView like this:

getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);

The problem with this approach is that after I do this, dialog is not displayed correctly. It doesn't show whole content of the inflated layout and it is really small. If I remove that line of code, dialog is displayed perfectly fine.

What could be causing this problem and how to solve it? Thank you.

user3339562
  • 1,325
  • 4
  • 18
  • 34

1 Answers1

0

Try this code in your onCreate method like below:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light_Dialog_NoActionBar_MinWidth);
}
Mohammad Arman
  • 7,020
  • 2
  • 36
  • 50