I’m currently making ipad application.
I have create an uiviewcontroller which is appear with modal presentation.
When I open this view, it is blurred and I don’t know why…
Look, the left is clear, the right is blur :

My code :
- (IBAction)showView:(id)sender {
Myviewcontroller *myviewcontroller = [[Myviewcontroller alloc] initWithNibName:@"Myviewcontroller" bundle:nil];
myviewcontroller.modalPresentationStyle = UIModalPresentationFormSheet;
myviewcontroller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:myviewcontroller animated:YES];
myviewcontroller.view.superview.frame = CGRectMake(0, 0, 635, 400);
myviewcontroller.view.superview.center = self.view.center;
}
Do you have any idea ?
Thanks for you help
I guess the width of
635leads to problems when centering the view:Core Graphics handles co-ordinates as floats, not integers, so position views with sub-pixel accuracy is possible and will produce this anti-alias like blur-effect. This is possible because view coordinates are specified with CGRect, which uses CGPoint, where x and y are floats.
Try a width of
636pixels instead and you should be fine 🙂