7

第09课:在窗口中嵌入 Web 页面

 3 years ago
source link: https://blog.csdn.net/nokiaguy/article/details/108729649
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

使用 <webview> 标签可以在窗口中创造另外一个页面。不像 iframe,webview 在与应用程序不同的进程中运行,它与你的网页没有相同的权限,应用程序和嵌入内容之间的所有交互都将是异步的。

9.1 在 Web 页面中使用 <webview> 标签

<webview> 标签可以直接嵌入到 Web 页面中,代码如下。

 <webview id="geekori" src="https://geekori.com" style="width:400px; height:300px" ></webview>

装载包含上面代码的页面,就会在当前窗口中嵌入 https://geekori.com 的页面,如下图所示。

1240

不过在上面的代码中,通过样式限制了 <webview> 标签的尺寸,如果要让 <webview> 标签的尺寸自动调整,需要使用下面的代码。

<webview id="geekori" src="https://geekori.com"  style="height:700px" autosize minwidth="

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK