如何通过App Inventor 2中的WebViewer查看本地图像?

时间:2014-07-02 10:30:14

标签: android app-inventor

我需要在应用程序中安装图像。图像应该在应用程序内。 我想使用WebViewer,因为图像应该是可扩展的。

2 个答案:

答案 0 :(得分:1)

请参阅此代码段:https://puravidaapps.com/snippets.php#2ani

您可以使用webviewer组件直接访问图像。

将作为资产上载的HTML文档考虑到App Inventor有一件特别的事情:在开发过程中,您必须使用嵌入式HTML文档的开发路径。

file:///mnt/sdcard/AppInventor/assets/ani.gif

在构建应用程序之前,请使用生产路径。

file:///android_asset/ani.gif

enter image description here enter image description here

答案 1 :(得分:-1)

首先我在资源中上传了图片omrosu_ridica_omalbastru.png

然后我更改了您在 webviewstring2

提供的示例

如下

<h1>How to display some HTML text in a webviewer</h1> <h2>during runtime of your app</h2> <p>Just put your string together and pass it to the Webviewer using the <b>webviewstring</b> property.<br><br> <img src="file:///android_asset/omrosu_ridica_omalbastru.png" alt="PuraVidaApps" style="border:0;width:200px;height:187px;"></p><p><a href="https://puravidaapps.com">More great tricks you can find at puravidaapps.com</a>. Woo Hoo!</p>

它可以显示

的图像
<img src="file:///android_asset/omrosu_ridica_omalbastru.png" ... 

<img src="omrosu_ridica_omalbastru.png" ...

此致

米哈伊

相关问题