简体   繁体   中英

How to set View Controller of MFSlideviewcontroller using storyBoard?

I am using MfSlideviewcontroller, i have to add some labels using storyboard but when i am using story board the viewcontroller will be blank. And when i am doing with the help of code it is showing but i dont know the autolayout using code. can Any one tell me how to use this in storyboard and why the screen is blank? 在5s内推正确,但在6splus内

在此处输入图片说明

Have you setup your viewcontroller similar to what is done in the example in the project?

To use a storyboard, you'll need a viewcontroller and a splitviewcontroller.

For the splitviewcontroller, follow what he has done in his example,

  1. Create MFMasterViewController and MFDetailViewController.
  2. Create the splitviewcontroller and set it's delegate to MFDetailViewController.
  3. Create MFSideMenuContainerViewController with SideMenuViewControllers for the left and right.

For the viewcontroller, this is your initial viewcontroller or what you push to,

  1. Add MFSideMenuContainerViewController as a childviewcontroller.
  2. Add the view of MFSideMenuContainerViewController to the view of the viewcontroller.
  3. Setup constraints and call didMoveToParentViewController.

Example code,

[self addChildViewController:mfSideMenuContainerViewController];
[self.view addSubview:mfSideMenuContainerViewController.view];  
// setup all edge constraints
[mfSideMenuContainerViewController didMoveToParentViewController:self];

Hope this helps, ask me if you need me to clarify, good luck.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM