二级PopupWindow 在执行的时候报错:
The specified child already has a parent. You must call removeView() on the child's parent first.
原因:
在第二级的setContextView 的时候使用了第一级的listView,
解决办法:
在第二级的setContextView 的时候使用第二级别的listView
mProviderPopupWindow.setContentView(mProviderListView);
参考:
http://blog.youkuaiyun.com/yaolingrui/article/details/7339913

本文介绍了在使用PopupWindow进行嵌套显示时遇到的一个常见错误:“指定的孩子已有父元素”。文章详细解释了错误的原因,并提供了解决方案,即确保每个PopupWindow使用其专属的视图。
2756

被折叠的 条评论
为什么被折叠?



