MKUserTrackingBarButtonItem色调IOS7不起作用,但在IOS 6上起作用
我使用XCode 5以IOS6的最低操作系统为目标创建了如下的条形按钮项MKUserTrackingBarButtonItem色调IOS7不起作用,但在IOS 6上起作用,ios,uinavigationcontroller,ios7,uinavigationitem,mkusertrackingmode,Ios,Uinavigationcontroller,Ios7,Uinavigationitem,Mkusertrackingmode,我使用XCode 5以IOS6的最低操作系统为目标创建了如下的条形按钮项 self.navigationItem.rightBarButtonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView]; self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f
self.navigationItem.rightBarButtonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f];
然后像这样设置它的颜色
self.navigationItem.rightBarButtonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.mapView];
self.navigationItem.rightBarButtonItem.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f];
当我部署到IOS6设备时,条形按钮项的颜色正确,但在IOS7设备上它仍然是蓝色的
这是其他人经历过的问题吗?一个XCode 5错误
帮忙
感谢来自苹果文档的: 在iOS 6中,tintColor为导航栏、选项卡栏、工具栏、搜索栏、, 和范围栏。要在iOS 7中为条形背景着色,请改用barTintColor属性
我也没有找到解决方案,但我知道更改默认窗口颜色会覆盖它。如果您不介意覆盖默认窗口颜色,请对应用程序代理的didFinishLaunchingWithOptions方法执行以下操作
self.window.tintColor = [UIColor colorWithRed:175.0f / 255.0f green: 189.0f / 255.0f blue: 69.0f / 255.0f alpha:1.0f];
唉,不。我的问题是关于巴布顿的,而不是导航栏的背景。本指南第23页说明使用tintColor为按钮项目上色。正如我的问题所述,我正在这样做,我建议使用不同的(默认)条形按钮项,看看问题是否仍然存在。如果是这样的话,有些奇怪的事情正在发生。如果不是,那很可能是
mkusertrackingbarbuttoneim
中的一个bug。谢谢你,埃迪。