开发者

Uiwebview starting in landscape doesn't resize to portrait correctly, but starting in portrait everything works fine

This is a pretty weird error. I have a tab bar controller, with a nested navigation controller, which then has your standard tableview开发者_运维问答. When you click on a cell a new view is pushed onto the controller. This is a regular view with a nested uiwebview, that takes the entire view up.

When entering that view in portrait mode it looks great, when you rotate it to landscape it looks great, and back to portrait again is good.

But when you enter that view using landscape it looks great but rotating to portrait doesn't seem to resize, the width is still too wide and the text is larger.

I've tried 1.webView.frame = self.view.frame;-That didnt seem to change its behavior 2.Both the view and the webview are set to autosize and like i said it works when starting in portrait 3.[webView setFrame:CGRectMake(0, 0, 320,411)]; when rotating to portrait from landscape. This is really weird, it makes the webview consume half the screen. Font is still large. 4.I've changed the autoresize to disabled, manually resize them on orientation change and then do a [webView reload];

Ive tried various other things and combinations of things. This problem is consistent across all of my subviews that are webviews.

I am sort of new so please be as specific as you can.


Use <meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0;'> in the head of your html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜