How to addSubview with a position? How to addSubview with a position? ios ios

How to addSubview with a position?


Something like this:

myViewController = [[MyViewController alloc] initWithNibName:@"MyView" bundle:nil];myViewController.view.frame = CGRectMake(0, 100, myViewController.view.frame.size.width, myViewController.view.frame.size.height);  [mainCanvas addSubview: myViewController.view];self.view = mainCanvas;


In addition to setting the frame property, you can also set the center property of a view.


Set the frame property on the sub view.


matomo