Possible Duplicate:
Create a UIViewController that contain a UIViewController
I have a parent view with many subview in different viewcontroller because a part of screen is same with every view, so i create only needed part of other screen in other view controller nib.
Then i planed when a view need load i will just add it like subview and remove it switch to another screen
it’s just simple
viewController = []...
[self.view addSubview:viewController.view];
currentView = viewController.view;
currentView.setFrame :(aFrame); // to move to different part (all screen has a common part)
But my problem is new view is added to screen but it always stay at (0,0) no matter how frame i did set.
But weird thing is if i tap at part of screen in new frame it will be behavior like view was moved there but screen not redraw.
What wrong? Please help
You said:
I think that the problem could be related to the way the view is created in Interface Builder. Specifically, if you create a nib file and choose the “View” type, then a nib is created that contains a view with a fixed size (screen size).
So, my suggestion is trying and create a nib using the “Empty” template and then adding a UIView from the library. In this case, you will be allowed to set the view size (in the third pane of the Inspector). Possibly this will fix your problem.