zoukankan      html  css  js  c++  java
  • UIKitView在打开相机后冻结问题临时处理方案

    • flutter 1.20.2 版本iOS WKWebView 和 UIImagePickerController 冲突临时解决方案,目前最新的版本1.22.2已经修复了,项目改动小的可以直接升级
    • github issue地址: https://github.com/flutter/flutter/issues/65361

    frozen image

    • 异常情况的视图层级,对比发现开启相机后,再进入UIKitView页面会新增FlutterClippingMaskView,遮罩层
    • 正常情况的视图层级

    Related views

    1. FlutterTouchInterceptingView // A UIView that is used as the parent for embedded UIViews.
      //
      // This view has 2 roles:
      // 1. Delay or prevent touch events from arriving the embedded view.
      // 2. Dispatching all events that are hittested to the embedded view to
    2. FlutterView

      • bind engine delegate and create surface
    3. ChildClippingView

      • filter touch events
    4. FlutterClippingMaskView

      • chip the bottom views, (bloc the platform view touch events)

    Temp solution

    • 如果时再UIKitView所在的页面则不会出现这个问题,临时解决方案
    • remove FlutterClippingMaskView on webview loaded
        func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
            let lastView = webView.superview?.superview?.subviews.last
            if lastView?.description.contains("FlutterClippingMaskView") ?? false {
                lastView?.isUserInteractionEnabled = true;
                lastView?.removeFromSuperview();
            }
            print(#function,#line)
        }
    
    • disable the edge gestures for navigation
      body: WillPopScope(child: UiKitView(
            viewType: VIEW_TYPE,
            hitTestBehavior: PlatformViewHitTestBehavior.opaque,
            creationParams: {'url': 'https://www.baidu.com'},
            onPlatformViewCreated: (viewId) {
              channel = MethodChannel('${VIEW_TYPE}_$viewId');
            },
            creationParamsCodec: StandardMessageCodec(),
          ), onWillPop: () async {
            if (Navigator.of(context).userGestureInProgress) {
              return false;
            } else {
              return true;
            }
          },
          ),
    
  • 相关阅读:
    mysql 重置root 账户密码
    Applicationpoolidentity 好有趣哦
    类模板的困扰 LNK2019 (转)
    C++中定义比较函数的三种方法
    Spring的AOP,Struts2的拦截器(Interceptor),以及springMVC的(interceptor)
    MyBatis与Hibernate总结篇
    Java中的回调
    闲来重写一下快速排序
    【lucene】一个简单的招聘网站的建立
    【Lucene】小谈lucene的BooleanQuery查询对象
  • 原文地址:https://www.cnblogs.com/wwoo/p/uikitview-zai-da-kai-xiang-ji-hou-dong-jie-wen-ti.html
Copyright © 2011-2022 走看看