您的位置:首页 > 运维架构

使用PopupWindow实现Menu功能

2015-03-06 09:28 302 查看
参考:/article/5647168.html

注意:

PopupWindow会给PopupView设置Padding,会导致ContentView的左右上下都会存在空隙。

解决如下:

在显示PopupWindow(即执行PopupWindow.showAtLocation())后,重新设置PopupView的padding。

popupWindow.showAtLocation(x,x,x,x,);
ViewGroup popupView = (ViewGroup) popupWindow.getContentView().getParent();
if (popupView != null) {
popupView.setPadding(0, 0, 0, 0);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: