4***@qq.com
4***@qq.com
  • 发布:2024-01-08 13:14
  • 更新:2024-01-08 13:14
  • 阅读:238

请问Webview窗口native层实例如何设置Webview参数?

分类:Native.js

请问Webview窗口native层实例如何设置Webview参数?

在社区翻了一圈帖子好像都有问题,不确定怎么用。

反复琢磨了html5plus上面Native.js文档,分析应该是如下的用法:
比如设置userAgent

const nativeWebview = plus.android.currentWebview();  
const settings = plus.android.invoke(nativeWebview, 'getSettings');    
plus.android.invoke(settings, 'setUserAgentString','test');

invoke用来执行类或者实例上的方法,settings本身也是一个实例,所以也需要用invoke调用。请官方指点一下分析的对不对,是否是这样使用。

2024-01-08 13:14 负责人:无 分享
已邀请:

要回复问题请先登录注册