首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FrameLayout$LayoutParams不能转换为WindowManager$LayoutParams

FrameLayout$LayoutParams不能转换为WindowManager$LayoutParams
EN

Stack Overflow用户
提问于 2016-04-06 10:47:54
回答 1查看 479关注 0票数 0

我正面临类似的问题,在下面的链接中解释。但解决方案没有公布。请帮忙解决这个问题。

Android M ClassCastException: FrameLayout$LayoutParams cannot be cast to WindowManager$LayoutParams

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-06 11:40:35

不需要使用DialogActivity。只需再添加一个getParent()来访问容器。

代码语言:javascript
复制
 if (android.os.Build.VERSION.SDK_INT > 22) {
            container = (View) pwindow.getContentView().getParent().getParent();
        }else{
            container = (View) pwindow.getContentView().getParent();
        }
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36448832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档