iOS Slide/Swipe menu like facebook app

孤人 提交于 2019-12-04 16:02:08

问题


I know there are tons of projects, I searched in https://www.cocoacontrols.com/ and found some very interesting, like MasterDetailController, that is the simlpest one and I got working very good.

But now I have a problem, and probabbly you can help me with another cool and simple slide control, or just a matter of simple tweak of current control or coding.

The main issue is that the MasterDetailController must be set on self.window.rootViewControler = self.principal;

/* THIS IS THE APPDELEGATE */
// This is the slide menu view controller
UIViewController *master = [[UIViewController alloc] initWithNibName: @"MasterView" bundle: nil];
// This is the body view controller
ViewController *detail = [[ViewController alloc] initWithNibName: @"ViewController" bundle: nil];
// This is the Master detail controller 'driver'
self.principal = [[[MasterDetailController alloc] initWithMasterViewController: master detailViewController: detail] autorelease];
// Then we set the 'driver' as rootView
self.window.rootViewController = self.principal;
[self.window makeKeyAndVisible];

Now, I want more ViewControllers to have the slide menu like facebook app not just the rootViewController.

So, how can I do it?

Thanks.

PS: This is the control I am currently using https://www.cocoacontrols.com/controls/masterdetailcontroller


回答1:


if you are creating slide/swipe like facebook

application then follow link which is good example of this

https://github.com/edgecase/ECSlidingViewController




回答2:


How about this: https://www.cocoacontrols.com/controls/uiscrollslidingpages. Sliding scrolling viewcontroller. Instead of rootviewcontroller, pass this...




回答3:


You assign the slidecontroller to the uiview and then set the rootviewcontroller to your viewcontroller. This means that the slideviewcontroller will only work with the assigned view.

If you want to use the slidecontroller for other viewcontrollers you should do it the other way around and set the rootViewController to the slidecontroller.




回答4:


Here is one I wrote. Pretty simple to use. It's built on top of UINavigationcontroller and doesn't require any kind of sub-classing on your view controllers.

https://github.com/aryaxt/iOS-Slide-Menu




回答5:


You can use this simple library

https://github.com/arturdev/AMSlideMenu

This exactly what you need. Its FULLY customizable and with different animations. In demo project you can see how to implement multiple menus/viewControllers in your app.



来源:https://stackoverflow.com/questions/16731882/ios-slide-swipe-menu-like-facebook-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!