Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertController bug changing tintcolor of other UIImageViews

I have what I assume is an odd iOS8 bug. Whenever I launch a UIAlertControllerI find that it is changing all of the tint colors of my UIImageViews that use the UIImageRenderingModeAlwaysTemplate image rendering mode to a dark grey. This happens whether or not I adjust the tint color of the UIAlertController. Below find a screenshot (Look at the bubble corners) which were the correct color before the UIAlertController was displayed and return to the correct color once it is dismissed.

Anybody know how to prevent this in iOS8?

enter image description here

UIAlertController *alertController = [UIAlertController
                                      alertControllerWithTitle:[NSString stringWithFormat:@"Question ended %@",[endDateFormat stringFromDate:[NSDate dateWithTimeIntervalSince1970:selectedActivity.utc]]]
                                      message:messageText
                                      preferredStyle:UIAlertControllerStyleActionSheet];
[alertController.view setTintColor:[UIColor colorWithHue:240.0/360 saturation:.03 brightness:.58 alpha:1]];

//...Add some actions and then
[self presentViewController:alertController animated:YES completion:nil];
like image 885
Chase S Avatar asked Jul 27 '15 19:07

Chase S


1 Answers

Whenever a modal view is presented the tint color of the views behind it are changed to a gray "dimmed" color to indicate that they are not interactive. You should be able to fix this issue by setting the tintAdjustmentMode property of your UIImageViews.

See: UIKit Framework > UIView Class Reference > Configuring a View's Visual Appearance > tintAdjustmentMode

like image 94
CyberMoai Avatar answered Oct 14 '22 16:10

CyberMoai