I use full screen UIWebView to host / render an HTML5 application in iOS. I love Cordoba / the telephone very much, although I do not use them. I try to keep my webview size consistent with the base display. Unfortunately, on retina displays, the value returned by self.view.bounds depends on the scaling factor of UIScreen. So I get 1024x768 instead of 2048x1536. Not a huge problem, except that I then create a UIWebView using smaller borders (after setting for the status bar), and some things get a little jagged. In particular, I use the canvas at several points, and also the rounded borders seem thick. To be clear, this is not the case with scalable raster resources.
I do not get full screen resolution using this UIWebView. Ideally, I would like to set the screen scale to 1.0, but it doesn't seem to be supported. Any suggestions on how best to use the screen?
The problem is most noticeable on the iPhone 5 simulator. I donβt have the equipment to test. iPad / new iPad I think the problem is, but jaggies are not so noticeable.
Update. The more I look at it, the more I think it can be limited to canvas.
Solution: In case someone else gets here. Based on the answer below, I created all of my canvas elements with width and height multiplied by window.devicePixelRatio, and then set their style attribute to have the original (device-independent) size.
source share