0

This is strange, I have a ViewController which adds a MKMapView as a subview. There are some steps in the application which when executed causes the user location pin to change its color from blue to gray.

I have investigated in the following

  1. there is no place where tintColor is changed in code base
  2. used KVO to observe tint Color
  3. analyzed that in "viewWillAppear"(till last line) tintColor is "UIDeviceRGBColorSpace 0 0.478431 1 1" while in "viewDidAppear" tintColor changes to "UIDeviceWhiteColorSpace 0.392275 0.8"

Please elaborate if change in Color Space.

 CGFloat mapviewY = self.searchView.frame.origin.y + self.searchView.frame.size.height + 1;
CGFloat mapviewHeight = self.view.frame.size.height - mapviewY;
_klMapView = [[KMapMapView alloc] initWithFrame:CGRectMake(kScreenOrigin,
                                                           mapviewY,
                                                           SCREEN_WIDTH,
                                                           mapviewHeight)];
_klMapView.mapViewDelegate = self;
[self.view addSubview:_klMapView];

Thanks Ankit

8
  • Do you have some kind of modal/window level view added over the map at any point ?
    – Templar
    Jun 16, 2015 at 12:50
  • bhai @Ankit provide some code. Jun 16, 2015 at 13:00
  • @Templar nope no subview is added on top of map Jun 16, 2015 at 13:08
  • @HarvantS. sir please refer the code above Jun 16, 2015 at 13:09
  • UIDeviceWhiteColorSpace 0.392275 0.8 that mean you have 39% of RGB (all three Red, Green, Blue or white scale color) with 80% of transparency (A or alpha). Jun 16, 2015 at 13:15

2 Answers 2

0

Check out if you are using mapView(mapView: _, viewForAnnotation: _) and format it this way.

 func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -> MKAnnotationView! {
            if annotation.isKindOfClass(MKUserLocation) {
                return nil
            }
            // rest of your code
    }
2
  • this is what is happening while drawing annotations Jun 17, 2015 at 6:38
  • I didn't catch what you wanted to say? Jun 17, 2015 at 7:41
0

Ok so got the answer actually tintAdjustmentMode was getting changed. Fixed it by

mapView.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.