iphone – Change size of view – Education Career Blog

I put a button on view and want to call this view from another view and change size of this view but when i change size,size of button doesn’t change How can i change size of view that size of all controls on view changed?

Three *second = Three alloc initWithNibName:@"Three" bundle:nil;
 second.view.frame=CGRectMake(0, 0, 100, 100);
 self.view addSubview:second.view;


When the time comes to change the size of the view, at the following code.

second.view.frame = CGRectMake(a,b,c,d);

Where a, b, c, and d are integers.


Set the frame for the view in the Interface Builder, you’re using a nib anyway.
But I think it’s really strange what you made. You create a UIViewController and set the view of this controller as a subview of another controller’s view. Why don’t you directly compose that view in the same nib?

Leave a Comment