开发者

Adding subViews to UISplitViewController

开发者 https://www.devze.com 2022-12-27 14:25 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号