pod 'RESideMenu', '~> 4.0.7'
github 地址 ;https://github.com/romaonthego/RESideMenu
不缩放 self.scaleContentView = NO;
1. storyborad 添加 slideView
创建 一个 SlideViewController 继承 resideview
main.storyBoard 中 class 是 SlideViewController 添加 storyboradId 用于区分
2. storyboard 添加 LeftMenuViewController
添加 storyboradId 用于区分
3.storyboard 添加 contentViewController
添加 storyboradId 用于区分
拖入一个 navigation Controller 删除 tableViewController
拖入一个 UIViewController 连线到 navigation Controller 的rootView 删除里面的 view 等
拖入一个 navigation Controller Item 添加 一个 bar button item 连线自己 presentLeftViewController
运行 。。。
// // SlideViewController.m // BlogIteye // // Created by youbao on 16/10/22. // Copyright © 2016年 youbao. All rights reserved. // #import "SlideViewController.h" #import "RESideMenu.h" @interface SlideViewController ()<RESideMenuDelegate> @end @implementation SlideViewController - (void)awakeFromNib { self.menuPreferredStatusBarStyle = UIStatusBarStyleLightContent; self.contentViewShadowColor = [UIColor blackColor]; self.contentViewShadowOffset = CGSizeMake(0, 0); self.contentViewShadowOpacity = 0.6; self.contentViewShadowRadius = 12; self.contentViewShadowEnabled = YES; self.scaleContentView = NO; // 不缩放 self.contentViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"contentViewController"]; self.leftMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"leftMenuViewController"]; // self.rightMenuViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rightMenuViewController"]; //self.backgroundImage = [UIImage imageNamed:@"Stars"]; self.delegate = self; } #pragma mark - #pragma mark RESideMenu Delegate - (void)sideMenu:(RESideMenu *)sideMenu willShowMenuViewController:(UIViewController *)menuViewController { NSLog(@"willShowMenuViewController: %@", NSStringFromClass([menuViewController class])); } - (void)sideMenu:(RESideMenu *)sideMenu didShowMenuViewController:(UIViewController *)menuViewController { NSLog(@"didShowMenuViewController: %@", NSStringFromClass([menuViewController class])); } - (void)sideMenu:(RESideMenu *)sideMenu willHideMenuViewController:(UIViewController *)menuViewController { NSLog(@"willHideMenuViewController: %@", NSStringFromClass([menuViewController class])); } - (void)sideMenu:(RESideMenu *)sideMenu didHideMenuViewController:(UIViewController *)menuViewController { NSLog(@"didHideMenuViewController: %@", NSStringFromClass([menuViewController class])); } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(右上角的爱心标志,支持支付宝和PayPal捐助),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!