【发布时间】:2013-08-17 19:24:43
【问题描述】:
在我的 AppDelegate.m 文件中,我创建了以下后退按钮样式:
UIImage *backBtnImage = [UIImage imageNamed:@"back.png"];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage: backBtnImage forState: UIControlStateNormal barMetrics: UIBarMetricsDefault];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage: backBtnImage forState: UIControlStateHighlighted barMetrics: UIBarMetricsDefault];
由于某种原因,背景图像仅在点击按钮的空间后显示在每个视图上 - 之后每次都会为每个视图加载。
我已尝试清理项目但无济于事。
【问题讨论】:
-
您是在设置它并从主线程添加按钮吗?
-
上述代码在AppDelegate的didFinishLaunchingWithOptions方法中设置。已尝试将代码添加到 dispatch_async(dispatch_get_main_queue(), ^{... 块但仍然没有乐趣。当我按下视图控制器时,iOS 会自动添加后退按钮。
-
你好,我也有同样的问题。您发现问题所在了吗?
-
仍在寻找解决方案。运气好吗?
标签: iphone ios objective-c uibarbuttonitem