views:

26

answers:

2

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];
A: 

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.

joshim5
I do that but doesn't work
SajjadZare
+1  A: 

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?

burki
I want to resize view beacuse i want to add 4 views in this view and i should resize them
SajjadZare
Well, set the UIView as a IBOutlet, then set up the whole view in Interface builder, and then (at runtime) you add it as a subview and resize the view by setting a new frame.
burki