Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nazgul42

macrumors newbie
Original poster
Aug 1, 2008
7
0
I have a UIWebView set up that autorotates as I expect it to. The only thing is that when I rotate from portrait to landscape, the content of the UIWebView is scrolled up a couple of screens if it is a small page, or a large amount if the view is displaying a large page. When I rotate the app back to portrait view, the content scrolls back to where it is supposed to go. If I set the UIWebView's scalesPageToFit property to no, it does not do this, but then I cannot resize the content, which is undesirable. How can I make it so this does not scroll? Thanks you
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Try adding this

Code:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
	[myWebView reload];
}
 

nazgul42

macrumors newbie
Original poster
Aug 1, 2008
7
0
Thank you for your reply, but I did something different.
I have the web view store where it is scrolled to before it rotates, and .2 seconds after it rotates, I have it reload that scroll position. That works for me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.