在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:mikefrederick/MFSideMenu开源软件地址:https://github.com/mikefrederick/MFSideMenu开源编程语言:Objective-C 99.4%开源软件介绍:#MFSideMenu This project was inspired by the side-menu functionality seen in the Facebook iOS app. MFSideMenu utilizes view controller containment and gives you a simple API for implementing side-menu functionality. It integrates with storyboard-based apps as well as traditional setups. ======= ##Features
##Installation ####CocoaPods
Add ####Manually
Add the ##Usage ###Basic Setup In your app delegate: #import "MFSideMenu.h"
MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
containerWithCenterViewController:centerViewController
leftMenuViewController:leftMenuViewController
rightMenuViewController:rightMenuViewController];
self.window.rootViewController = container;
[self.window makeKeyAndVisible]; ###Opening & Closing Menus // toggle the left side menu
[self.menuContainerViewController toggleLeftSideMenuCompletion:^{}];
// toggle the right side menu
[self.menuContainerViewController toggleRightSideMenuCompletion:^{}];
// close the side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateClosed completion:^{}];
// open the left side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateLeftMenuOpen completion:^{}];
// open the right side menu
[self.menuContainerViewController setMenuState:MFSideMenuStateRightMenuOpen completion:^{}]; ###Pan Modes You can specify which areas you want to allow pan gestures on: // enable panning on the center view controllers & the side menus (this is the default behavior):
menuContainerViewController.panMode = MFSideMenuPanModeCenterViewController | MFSideMenuPanModeSideMenu;
// disable panning on the side menus, only allow panning on the center view controller:
menuContainerViewController.panMode = MFSideMenuPanModeCenterViewController;
// disable all panning
menuContainerViewController.panMode = MFSideMenuPanModeNone; ###Panning Custom Views You can add panning to any view like so: [panView addGestureRecognizer:[self.menuContainerViewController panGestureRecognizer]]; ###Listening for Menu Events You can listen for menu state event changes (i.e. menu will open, menu did open, etc.). See MFSideMenuContainerViewController.h for the different types of events. [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(menuStateEventOccurred:)
name:MFSideMenuStateNotificationEvent
object:nil];
- (void)menuStateEventOccurred:(NSNotification *)notification {
MFSideMenuStateEvent event = [[[notification userInfo] objectForKey:@"eventType"] intValue];
MFSideMenuContainerViewController *containerViewController = notification.object;
// ...
} ###Menu Slide Animation With this option enabled, the side menus will slide in & out with the center view controller. This effect is similar to the Wunderlist side menu. // enable the menu slide animation
[menuContainerViewController setMenuSlideAnimationEnabled:YES];
// control the exaggeration of the menu slide animation
[menuContainerViewController setMenuSlideAnimationFactor:3.0f]; ###Shadow MFSideMenu gives you the option to show a shadow between the center view controller & the side menus. // enable/disable the shadow
[menuContainerViewController.shadow setEnabled:YES];
// set the radius of the shadow
[menuContainerViewController.shadow setRadius:10.0f];
// set the color of the shadow
[menuContainerViewController.shadow setColor:[UIColor blackColor]];
// set the opacity of the shadow
[menuContainerViewController.shadow setOpacity:0.75f];
##Contact |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论