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;
网友评论