Display HTML data on a page : corona SDK

徘徊边缘 提交于 2019-12-07 16:47:31

问题


In one of my apps in corona, I have to display a html table in a scene. Is it possible to display a html table(whose html data string is generated within the app) on a normal page of corona sdk app..?

Any advice is appreciable...


回答1:


I think I understand what you are asking, and if so, then yes, of course you can!

What you need to do is use the API for WebView.

Note: Native web views are only supported on Android, iOS, the Corona Simulator for OS X, and OS X desktop apps. see documentation here

You can load local or remote html files using this API.

local webView = native.newWebView( 0, 0, 320, 480 )
webView:request( "http://www.coronalabs.com/" )
-- or
webView:request( "localfile.html", system.ResourceDirectory )

I have done this quite a few times in a medical app I was developing, where I would link customers to medical products directly from my app, and then when they were finished browsing, they could close out the webview and continue using the app as normal.

If you desire similar functionality to this, all you need to do is set up your webview, and create a overlay with some kind of back button the user can press to kill the webview, which should be fairly explanatory from the API.



来源:https://stackoverflow.com/questions/15176729/display-html-data-on-a-page-corona-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!