Skip to content

使用 UIWindowSceneDelegate 的项目,QMUIPopupMenuView 无法以 window 的方式显示 #766

@mrsunx

Description

@mrsunx

Bug 表现
问题的具体描述
用Xcode11 新创建的项目,带有SceneDelegate。 如果不做任何处理,用第一种方式,QMUIPopupMenuView show会闪退,参照网上的解决方案,做了如下处理

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
       let appDelegate = UIApplication.shared.delegate as! AppDelegate
        appDelegate.window = window
       guard let _ = (scene as? UIWindowScene) else { return }
}

处理之后,浮窗不展示。怀疑和iOS13的 UIWindowScene有关

相关链接 https://stackoverflow.com/questions/57060606/uiwindow-not-showing-over-content-in-ios-13
截图
Bug 现场的界面截图,或者 Xcode 控制台的错误信息截图,有问题的代码截图

如何重现

  1. ...
  2. ...

预期的表现
正常情况下,应该是什么表现

其他信息

  • 设备: [例如模拟器、iPhone、iPad]
  • iOS 版本: [iOS 13.x]
  • Xcode 版本: [Xcode 11.x]
  • QMUI 版本: [4.x.x]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions