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.