I’m using newWebView to show help overlays for different screen, so I can just edit the HTML help files using a HTML editor, which makes things easy.
Issue is that for iPad’s I have a different config.lua screen “width” and “height”, so the overall application (including UI components) scale appropriately. This has the impact of the help text in the webView being too large for iPads.
Question - This is the approach I think I’ll have to take, so would be interested if there is something easier that I’m overlooking.
Approach:
a) Set the content “width” for the newWebView via putting a “meta” tag in the html. This seems to be the way to get control over the size of the text appearing. e.g. set standard size HTML text, then use content width to scale overall HTML appropriately for the webview
\<html style="font-size: 20px;"\> \<head\> \<meta content="text/html; charset=windows-1252" http-equiv="content-type"\> \<meta name="viewport" content="width = 640"\> \<title\>\</title\> \</head\>
b) Now I need a different value of width above for iPad versus other so I was actually going to do this:
- when someone clicks on help
- read in HTML text from file
- search/replace the content=“width = 640” to the right value, depending on device
- write to temp file
- then load into webview
Any comments/thoughts? thanks.