Kevin
Kevin

Reputation: 1465

Set height of UIWebView in code

I have an UIWebView that I've added to the Storyboard via interface builder. However I want to be able to change the height of the UIWebView within the code but I wan't been able to accomplish that by myself.

This is the code I tried to use which I was hoping that it would make the UIWebView shorter from the bottom.

CGRect oldFrame = WebView.frame;

CGRect newFrame =CGRectMake(oldFrame.origin.x, oldFrame.origin.y, oldFrame.size.width, oldFrame.size.height-100);
[WebView setFrame:newFrame];

Upvotes: 0

Views: 811

Answers (1)

abmussani
abmussani

Reputation: 451

Please turn off Auto Layout feature in storyboard. this will solve your problem.

Upvotes: 2

Related Questions