美文网首页
AUCustomNavigationBar

AUCustomNavigationBar

作者: 山已几孑 | 来源:发表于2019-08-23 14:12 被阅读0次

    AUCustomNavigationBar,使用过程中发现,rightItem加不上,测试发现,只有满族下面两个条件才可以显示在相应位置

            [navBar setRightItem:photo];
            [navBar addSubview: photo];
    

    完整代码如下

            AUCustomNavigationBar *navBar = [AUCustomNavigationBar navigationBarForCurrentVC:self];
            [navBar setNavigationBarBlurEffective]; // 毛玻璃效果
            [self.view addSubview:navBar];
            [navBar setBackgroundColor:UIColor.clearColor];
            navBar.title = @"扫码登录";
            navBar.titleColor = UIColor.whiteColor;
            navBar.backButtonTitleColor = UIColor.whiteColor;
            
            AUButton * photo = [[AUButton alloc] initWithFrame:CGRectMake(0, 0, 35, 35)];
            [photo setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
            [photo setTitle:@"相册" forState:UIControlStateNormal];
            [photo addTarget:self action:@selector(selectPhoto) forControlEvents:UIControlEventTouchUpInside];
            [navBar setRightItem:photo];
            [navBar addSubview: photo];
            navBar.backButtonTitle = @"返回";
            
            _navBar = navBar;
    

    相关文章

      网友评论

          本文标题:AUCustomNavigationBar

          本文链接:https://www.haomeiwen.com/subject/ugzzsctx.html