gpt4 book ai didi

iphone - 模态 ViewController 消失后,iOS 7 自定义后退按钮消失

转载 作者:搜寻专家 更新时间:2023-10-30 20:18:51 26 4
gpt4 key购买 nike

我将自定义后退按钮添加到 UIViewController 中的 UINavigationBar,如下所示:

-(void)viewDidLoad {
UIBarButtonItem *customBackButton = [[UIBarButtonItem alloc] initWithTitle:@" " style:UIBarButtonItemStyleBordered target:self action:@selector(navigateBack)];
[customBackButton setBackButtonBackgroundImage:barBackBtnImg forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[customBackButton setBackButtonBackgroundImage:barBackBtnImgHighlighted forBarMetrics:UIBarMetricsDefault];
self.navigationItem.backBarButtonItem = customBackButton;
}

在我按下模态 UIViewController 并再次将其关闭之前,它工作得很好。发生的事情是标准的 iOS 7 后退按钮被绘制在我的自定义后退按钮上。

这看起来像是 iOS 7 的错误。知道如何解决它吗?

最佳答案

如果您将代码移动到viewWillAppear:(BOOL)animated,它应该可以工作。这有点 hack,但它应该有效。

关于iphone - 模态 ViewController 消失后,iOS 7 自定义后退按钮消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18876485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com