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


    关于使用 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 使用方法二
  • 相关阅读:
    C++ set简介及简单应用
    windows下安装scrapy报错:building 'twisted.test.raiser' extension error: Microsoft Visual C++ 14.0 is required.
    jsp调用Python脚本存取文件
    mysql触发器问题
    javascript调用alert()
    jsp调用Python
    注意细节,注意细节,注意细节
    pandas读取csv文件报错
    [kuangbin带你飞]专题四 最短路练习
    计算机网络之网络应用(应用层)上
  • 原文地址:https://www.cnblogs.com/benpaobadaniu/p/5452923.html
Copyright © 2020-2023  润新知