0

I have a navigation controller that controls view switch. How can I show a view without removing the current view?

4

2 回答 2

0

如果您的新视图有视图控制器使用

[self.navigationController presentModalViewController:newController Animation:YES];

于 2012-05-04T08:45:50.547 回答
0

This will add a view to the viewcontrollers view.

[parentView addSubview:subView];

This will add the view in variable subView into the view in variable parentView. In your case this would mean parentView is the viewcontroller's view and the subView is the view you want to add.

You can change the position of the subView in the parentView by setting the subview's subview.frame property.

If you are talking about a viewController you want to show take a look at the answer of Andiih.

于 2012-05-04T08:48:28.200 回答