分类分类
大小:163.72 KB更新:2014/09/24
类别:其他系统:Android
其实popupwindow用起来比Dialog 方便,因为dialog一切都需要你自己来实现,而popupwindow帮我们实现了很多,我认为在使用的时候关键我们要看清参数:
popupWindow.showAtLocation(parent, gravity, x, y);
parent这个是一个父view试图,
gravity 这个默认是居中,我们要指定显示方式:Gravity.LEFT
| Gravity.TOP
最后两个参数就是显示的坐标位置,这样就可以根据需求自己定位显示位置了
效果图: