开发者

ipad page/form modal view's are no longer transparent in 4.2.1

In my app I have been using page and form modal view controllers like the following:

quickTemplateViewer.modalPresentationStyle = UIModalPresentationPageSheet;
quickTemplateViewer.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[parent presentModalViewController:myView animated:YES];

I have an offset close button that hangs over the view on the top left (the view is slightly smaller than the designated modal view size), and it has been working well as the background of hte modal view is partially transparent.

I upgraded to 4.2.1 and suddenly instead of a semi-transparent black background with a drop shadow I have a white background with round开发者_如何学Pythoned corners. Is there a new setting to turn it back to transparent?

Thanks


I spent all day searching for a solution on this, and eventually gave up and made my own solution.

Basically what I did was instead of loading my 'modal' with presentModalViewController, I just added a full size view with a black backgroundColor that had 80% opacity so that it shows the view underneath a little dimmed.

Inside of this view, I added the view that I usually loaded with presentModalViewController with the appropiate X & Y coordinates. this way, you mimic the behavior of the UIModalPresentationPageSheet: you get a dimmed background, and the user can't use any UIControl that's underneath.

it's probably not the best implementation, but it's the best I could come up with. Hope something similar works for you guys.

-- UPDATE

Mike asked how did I implement the animations that usually come with the modal. Basically, what I used was a UIView animationTransition:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:
   UIViewAnimationTransitionFlipFromLeft forView:anotherView cache:YES];
[mainContainer addSubview:modal.view];
[UIView commitAnimations];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜