Why is the width of the dialogue not right?



  • Got it. DialogFragment♪ ♪ onResume comply with the following code to change the width of the dialogue:

    getDialog().getWindow().setLayout(730, LinearLayout.LayoutParams.WRAP_CONTENT);
    

    Attack on one of the inners. view Calling

    Toast.makeText(getActivity(), "w = " + getDialog().getWindow().getAttributes().width, Toast.LENGTH_LONG).show();
    

    Turns 730 right back, but I can see that there's less room in the eye. I'm squeaking, and I'm looking at the size of the dialogue.

    What do I not understand? Why is the width of the dialogue not right?



  • Problem solved by the installation

    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2