I’m creating a banner using a UIWebView and a UIViewController. In the controller I set shouldAutorotateToInterfaceOrientation to always return YES. In loadView, I create my UIWebView and give it a small banner frame using CGRectMake. Everything works when it’s added to the screen. The problem occurs when the screen rotates. The UIWebView now takes over the whole screen. If I output its frame using NSLog, I can see that it gets overwritten by the rotation to take up the whole screen. Any idea how to get it to stop doing this? I feel I’m missing something fundamental, but I cannot figure out what is wrong.
I’m creating a banner using a UIWebView and a UIViewController. In the controller I
Share
if you load UIWebview, on rotation you should set the width of the UIWebview to 480 and thats will be done on declaring a javascript function on the page you load and then on delegate
note makeWidth(480) is a javascript function in the page you load, you should declare that function in your webview and call it from xcode.