简体   繁体   中英

Change size of view

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM