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;
            }
          },
          ),
    
  • 相关阅读:
    yii框架中的各种小问题
    yii框架无限极分类的做法
    yii框架中的下拉菜单和单选框
    yii框架定时任务的操作
    yii框架里DetailView视图和GridView的区别
    git的使用(1)
    mysql 连接问题
    PHP字符串函数
    phpdocmentor 生成php 开发文档(转载)
    使用Nginx的X-Accel-Redirect实现大文件下载
  • 原文地址:https://www.cnblogs.com/wwoo/p/uikitview-zai-da-kai-xiang-ji-hou-dong-jie-wen-ti.html
Copyright © 2011-2022 走看看