Adding subViews to UISplitViewController
I have this button on the leftside of my UISplitViewController (RootViewController) that has a "Add New" button. I want the user to be able to click the button a new view come pop up so the user can add a new RSS feed to their subscription. So far I have the button and the "Add New" button correctly calling a method in the controller, but there's no way for me to add superviews or subviews. What's 开发者_JAVA技巧the best way to go about doing this?
I think you might be looking for UISplitViewController.viewControllers. Something like this will allow you to access the subviews for the left and right panels of the split view controller. Assuming splitViewController
is your split view controller:
UIViewController* leftController = [splitViewController.viewControllers objectAtIndex:0];
UIViewController* rightController = [splitViewController.viewControllers objectAtIndex:1];
UIView* leftView = leftController.view;
UIView* rightView = rightController.view;
Afterwards, you can add subviews in the normal way to leftView
and rightView
.
精彩评论