Introduction - If you have any usage issues, please Google them yourself
其实popupwindow用起来比Dialog 方便,因为dialog一切都需要你自己来实现,而popupwindow帮我们实现了很多,我认为在使用的时候关键我们要看清参数:
popupWindow.showAtLocation(parent, gravity, x, y)
parent这个是一个父view试图,
gravity 这个默认是居中,我们要指定显示方式:Gravity.LEFT
| Gravity.TOP
最后两个参数就是显示的坐标位置,这样就可以根据需求自己定位显示位置了