我有我认为是一个奇怪的iOS8错误.每当我发布一个,UIAlertController我发现它正在改变我UIImageViews使用UIImageRenderingModeAlwaysTemplate图像渲染模式为深灰色的所有色调颜色.无论我是否调整色调,都会发生这种情况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];
Run Code Online (Sandbox Code Playgroud) 我UIViewControllerTransitioningDelegate用来在两个视图控制器(从a MKMapView)到构建在(AVFoundation)上的自定义Camera 之间构建自定义转换.一切顺利,直到我打电话presentViewController,手机似乎挂了大约1秒钟(当我记录所有东西时).这甚至似乎发生在我转换到更简单的视图时(我有一个视图控制器只显示一个UITextview,甚至在实际调用转换之前似乎有大约.4 - .5秒的延迟).
这是我现在称之为过渡的方式
dispatch_async(dispatch_get_main_queue(), ^{
UIStoryboard* sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
CameraViewController *cvc2 = [sb instantiateViewControllerWithIdentifier:@"Camera"];
cvc2.modalPresentationStyle = UIModalPresentationFullScreen; // Needed for custom animations to work
cvc2.transitioningDelegate = self; //Conforms to the UIViewControllerTransitioningDelegate protocol
[self presentViewController:cvc2 animated:YES completion:nil];
});
Run Code Online (Sandbox Code Playgroud)
这是我animateTransition打电话的方法.非常直接,目前呈现此视图的视图上只有一个MkMapView(没有其他视图或方法).
-(void)animateTransition:(id<UIViewControllerContextTransitioning>)transitionContext {
if (self.type == MapAnimationTypePresent) {//From map to another view
UIView *containerView = [transitionContext containerView];
UIViewController *fromViewController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *toViewController = …Run Code Online (Sandbox Code Playgroud) avfoundation uiviewcontroller mkmapview ios presentviewcontroller