R – Problem with the scrollbar of a UIWebView

iphoneobjective cscrollbaruiwebview

Im using a UIWebView to access a website, when i rotate the phone (landscape) the UIWebView is properly resized and the scrollbar are on the right place (on the right edge…) but when i acess any of input fields to fill the information required and exit it the UIWebView scrollbar jumps to the middle of screen (looks like it get back to 320, the width of the screen on portrait). Some useful info, this program was created using IB, have lots of outlets, im thinking about in do (redo) everything programmatically cause i was not the author of the first version… If anyone have seen this before plz let me know..

Thanks in advance!

Best Answer

Dont add your webview into self.view just assign it.Simple thing works like awesome

wv = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];

[self.view addSubview:wv];

instead do

self.view = wv;

Related Topic