提交 858e12b5 编写于 作者: lizhongyi_'s avatar lizhongyi_

iOS 平台实现webview检测原生view是否存在

上级 c7739096
import { CanWebViewGoBack, CanWebViewGoForward } from "../interface";
import { CanWebViewGoBack, CanWebViewGoForward, HasNativeView } from "../interface";
import { WKWebView } from 'WebKit';
export const canWebViewGoBack : CanWebViewGoBack = function (elementId : string) : boolean {
......@@ -20,3 +20,13 @@ export const canWebViewGoForward : CanWebViewGoForward = function (elementId : s
}
return false;
}
export const hasNativeView : HasNativeView = function (elementId : string) : boolean {
// const element = uni.getElementById(elementId)
const element = DCGetElementByID.dcGetElementById(elementId)
const view = element?.getIOSView();
if (view != null && view instanceof WKWebView) {
return true;
}
return false;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册