参考:http://www.cnblogs.com/sw926/p/3230659.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);
}

 

相关文章:

  • 2022-12-23
  • 2021-04-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-11-23
  • 2021-04-13
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2021-06-14
  • 2021-09-18
  • 2021-07-01
  • 2021-09-11
  • 2022-12-23
相关资源
相似解决方案