1

我试图按照这里的文档:

http://zebble.net/docs/webview-class-displaying-html

我制作了一个网页并尝试从本地文件夹在设备中显示它,为此我从 Zebble.net 网站找到了一个示例代码,用于在设备中显示网页。我尝试在下面显示带有此代码的页面。

<WebView Url="Resources/index.html" />

但是,它显示了这个错误:找不到文件:/Resources/index.html

然后我将其更改为下面的代码,但它再次不起作用。

<WebView Url="/Resources/index.html" ></WebView>
4

1 回答 1

0

要在 Zebble 中的 WebView 中显示本地 html 文件,您无需在 URL 中写入“资源”。尽管该文件位于 Resources 文件夹中,但您应该省略该部分,因为它是隐含的。

请参阅http://zebble.net/docs/accessing-files-and-folders

以下代码将在 App.UI\Resources 文件夹中显示一个名为 index.html 的 HTML 文件:

<WebView Url="/index.html">

这是用于测试的完整 Zebble 页面的代码:

<z-Component z-type="MyPage" z-base="Templates.Default" 
     z-namespace="UI.Pages"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="./../.zebble-schema.xml">

       <WebView Url="/index.html" />

</z-Component>
于 2017-04-13T15:16:25.267 回答