MKMapView使导航栏变得透明

geo*_*iva 12 uinavigationbar mkmapview ios7

我将现有的iOS 6应用程序移植到新的iOS 7中.但是每当MKMapView实例出现在屏幕上时,我的导航栏就会失去其色彩.

重现步骤:

  1. 打开Xcode;

  2. 创建一个新的Master-Detail应用程序;

  3. 添加下一行作为AppDelegate.m didFinishLaunchingWithOptions方法的第一行:

    [[UINavigationBar appearance] setBarTintColor:[UIColor redColor]]

  4. 将下一行添加到MasterViewController.m文件中:

    #import <MapKit/MapKit.h>

  5. 最后,将下一行添加到MasterViewController.m cellForRowAtIndexPath方法:

    MKMapView *view = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 100, 40)]; [cell.contentView addSubview:view];

  6. 构建并运行

这些是结果:

好 导航栏变得透明 发布用户界面

难道我做错了什么?我该怎么做才能解决这个问题?

我应该开始使用Google Maps API吗?

小智 0

看来这个问题现在已经修复了(最新的 ios 版本)。我在模拟器和设备上都没有收到错误。