About PopuWindow cannot be displayed

                                  About the problem that PopuWwindow cannot be displayed

       When PopuWindow is called, PopuWindow has been instantiated and PopuWindow's setContentView method is called, but this PopuWindow cannot be displayed. The reason is that you have not set the height and width of PopuWindow. Call PopuWindow's setHeight and setWidth methods to set the height and height of PopuWindow. Wide, for example

pw.setWidth(LayoutParams.WRAP_CONTENT);

pw.setHeight(LayoutParams.WRAP_CONTENT);


PS: PopuWindow depends on the Activity it is attached to, so when your Activity is destroyed, you must destroy PopuWindow, otherwise it will cause WindowLeak problems.

Guess you like

Origin blog.csdn.net/skateboard1/article/details/44262631