【发布时间】:2013-09-25 14:21:02
【问题描述】:
我有一个自定义的UIBarButtonItem,其图像在 iOS 6.1 中运行良好。但是 iOS 7 有一个tintColor,它会将这种颜色覆盖在我的图像上。如果我将tintColor 设置为[UIColor clearColor],则按钮不会一起显示。
如何让我的后退按钮在 iOS 7 中像在 iOS 6 中一样显示?请帮忙?
【问题讨论】:
-
您不应将条形按钮项用作后退按钮。而是为导航栏设置
backIndicatorImage。 -
应用程序必须在所有 iOS 版本中具有相同的外观。
backIndicatorImage仅适用于 iOS 7。我已经在 iOS 6 中使用了maskconst float colorMask[6] = {222, 255, 222, 255, 222, 255}; UIImage *image = [UIImage imageWithCGImage: CGImageCreateWithMaskingColors([[UIImage alloc] init].CGImage, colorMask)]; [backButtonItem setBackgroundImage:image forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; -
我用的是ios5,你能帮帮我吗
标签: iphone ios objective-c ios6 ios7