首页 > 其他 > 详细

使用 DDMenuController 类的方法(非常好用的抽屉类)

时间:2016-05-02 19:50:28      阅读:249      评论:0      收藏:0      [点我收藏+]

关于使用 DDMenuController 类的方法笔记:参考

DDMenuController 是一款非常好用的抽屉类文件。

技术分享
#pragma mark - 界面配置左右导航条的按钮
    //[self configureLeftButton];//配置导航条左边按钮
    [self configureRightButton];//配置导航条右边按钮

上面是要在ViewDidLoad 里面调用的

下面是方法的实现
#pragma mark - 界面配置类
//配置导航条左边按钮
- (void)configureLeftButton {
    UIBarButtonItem *left = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"qr_toolbar_more_hl"] style:UIBarButtonItemStylePlain target:self action:@selector(handleLeftBack:)];
    self.navigationItem.leftBarButtonItem = left;

}
//配置导航条右边按钮
- (void)configureRightButton {
    UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"qr_toolbar_more_hl"] style:UIBarButtonItemStylePlain target:self action:@selector(handleRightBack:)];
    self.navigationItem.rightBarButtonItem = right;

}
#pragma mark -action
//导航条左边按钮点击事件
- (void)handleLeftBack:(UIBarButtonItem *)item {
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    DDMenuController *menuC  = delegate.menuController;
    [menuC showLeftController:YES];
}
//导航条右边按钮点击事件
- (void)handleRightBack:(UIBarButtonItem *)item {
    AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
    DDMenuController *menuC  = delegate.menuController;
    [menuC showRightController:YES];
}
View Code 使用方法一
技术分享
可以使用appdelegate

-(void)leftBtnClick
{
    [(DDMenuController *)[UIApplication sharedApplication].delegate.window.rootViewController showLeftController:YES];
    
}
View Code 使用方法二

 

使用 DDMenuController 类的方法(非常好用的抽屉类)

原文:http://www.cnblogs.com/benpaobadaniu/p/5452923.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!