导航栏颜色看起来不正确

Navbar colour doesn't look right

我已经将我的导航栏设置为白色或至少尝试过。然而,它看起来并没有看起来很白。

这是我设置它的代码。

    - (void)viewDidLoad {
        [super viewDidLoad];
        [self addSidebarNavButton];

        // Set the navbar
        [self setEdgesForExtendedLayout:UIRectEdgeNone];
        UILabel *nav_titlelbl=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, self.navigationItem.titleView.frame.size.width,40)];
        nav_titlelbl.text=@"";
        nav_titlelbl.textAlignment=NSTextAlignmentCenter;
        UIFont *lblfont=[UIFont fontWithName:@"Futura-Medium" size:20];
        [nav_titlelbl setFont:lblfont];
        self.navigationItem.titleView=nav_titlelbl;

        // Set the navbar colour
        self.navigationController.navigationBar.barTintColor =
        [UIColor colorWithRed:255.0/255.0f green:255.0/255.0f blue:255.0/255.0f alpha:1.0];
        self.navigationController.navigationBar.translucent = YES;

很遗憾,我无法在此处附加导航栏图片,因为我没有所需的 10 点声望。但是,如果可以的话,您会看到有问题的导航栏看起来是浅灰色的!

设置 self.navigationController.navigationBar.translucent = NO; 您可能会看到视图背景。