我有我认为是一个奇怪的iOS8错误.每当我启动UIAlertControllerI时,我发现它正在将使用UI
ImageRenderingModeAlwaystemplate图像渲染模式的UIImageViews的所有色调颜色更改为深灰色.无论我是否调整UIAlertController的色调颜色,都会发生这种情况.下面找到一个截图(查看气泡角),它们是显示UIAlertController之前的正确颜色,并在解除后返回正确的颜色.
有谁知道在iOS8中如何防止这种情况?
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];
解决方法
每当呈现模态视图时,其后面的视图的色调颜色将更改为灰色的“暗淡”颜色,以指示它们不是交互式的.您应该能够通过设置UIImageViews的tintAdjustmentMode属性来解决此问题.
看到:
UIKit Framework > UIView Class Reference > Configuring a View’s Visual Appearance > tintAdjustmentMode