Search code examples
iosios7uiviewuipopovercontrolleruicolor

Tint Color fading when popover displayed


I have a simple block of code wherein I am setting the tint color of a UIView. Under normal condition, this works well, but when I present a popover from somewhere, the rgb tint color fades to grayscale colors.

Once the popover is dismissed, the colors return to their normal values.

The code runs something like this:

UIView *view = self.imageViews[index];
view.tintColor = tintColor;

Is there a way to stop these colors from fading under presence of popover ?

Thanks in advance.


Solution

  • UIView has a property called tintAdjustmentMode. Did you try that out ??

    A single line code like

    view.tintAdjustmentMode = UIViewTintAdjustmentModeNormal;
    

    could help you out in this case.

    Edit: Swift 4.2 update:

    view.tintAdjustmentMode = .normal