问题
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