代码之家  ›  专栏  ›  技术社区  ›  Laurence Wingo

是什么原因导致导航栏在设置两个barItem属性后都变成白色的模糊颜色?

  •  0
  • Laurence Wingo  · 技术社区  · 7 年前

    我正在建立一个导航控制器和导航栏突然添加了这个白色模糊的颜色导航栏,我不知道这是什么性质。我试过关闭半透明并设置背景色,但是新的红色背景色出现在白色模糊的颜色后面。是什么导致了这种白色模糊的颜色,我该如何去除它?

    这是我的代码:

    UIBarButtonItem *btnCancel = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelButtonPressed)];
        self.navigationController.topViewController.navigationItem.leftBarButtonItem = btnCancel;
    
        UIBarButtonItem *btnSave = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:nil action:nil];
        self.navigationController.topViewController.navigationItem.rightBarButtonItem = btnSave;
    

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  0
  •   Laurence Wingo    7 年前

    问题是我把代码放在视图里面会出现设置了一个整型变量。据我所知,视图加载应该在视图出现之前,所以我不明白为什么会发生这个问题,但这是问题所在。

    推荐文章