导航条

作者: 孤傲灬流年_9c04 | 来源:发表于2018-07-30 07:41 被阅读0次

     self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];

        // 设置导航条图片

        UIImageView *imgV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"导航条图片"]];

        // 添加到导航条

        self.navigationItem.titleView = imgV;

        // 设置导航条按钮

        UIButton *navBtn = [UIButton buttonWithType:UIButtonTypeRoundedRect];

        navBtn.frame=CGRectMake(0,4,40,40);

        // 添加图片并设置防止图片渲染

        [navBtnsetImage:[[UIImage imageNamed:@"导航条按钮"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];

        UIBarButtonItem *barBtn = [[UIBarButtonItem alloc]initWithCustomView:navBtn];

        self.navigationItem.rightBarButtonItem = barBtn;

    相关文章

      网友评论

          本文标题:导航条

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