UIWebView doesn't display correctly when screen orientation changes
I have a UIWebView as a subview of one of my view controller views, in a navigation controller based app.
When the view is displayed (device is either in portrait or landscape), the UIWebView and content looks perfect. However, if I rotate the device, the UIWebView rotates, but it's frame doesn't change. Meaning, if it was in portrait, and then rotated to landscape, I see a big 开发者_Python百科gap on the right side, and when I check the frame value of the web view, it shows that it hasn't changed.
So, naturally I added code to detect when the device was rotated, and reset the frame of the UIWebView. Well, now the web view takes up the entire screen, but the text on the page has become giant, like some auto-zoomed. I have no clue what's happening here.
What is the best way to keep a UIWebView subview displaying correctly when the device is rotated?
Problem resolved, I had set the autoreszing mask to flexible height by mistake, Instead of just letting the navigation view controller handle it.
精彩评论