I'm implementing a fairly standard UIView
animation, using UIViewAnimationTransitionCurlUp
. The basic idea is that I have a folder on the screen covered with a stack of pages, and as I change from page to page I use the curl up animation. Each page is a subview that takes up about 70% of the screen so that the clipboard is still visible in the background.
T开发者_开发百科his animation all works fine, that problem is that even though each "page" (which is a separate UIViewController
& UIView
) has a transparent background, the page background becomes visible during the page curl. It's only slightly visible, like a black background with an alpha of 0.1. But it ruins the effect.
Any ideas? This is for a private application that will not be distributed on the app store, so private APIs are ok.
You will need to change the size of the view
of your page view controller to be exactly the size of your page image. It looks from your included image that your page is also rotated. You can apply a rotation to your view to match this rotation. Here is part of the code that I used to achieve the effect in the screenshot:
[self addChildViewController:self.pageViewController];
[self.view addSubview:self.pageViewController.view];
CGRect pageViewRect = CGRectMake(0, 0, 300, 586);
self.pageViewController.view.frame = pageViewRect;
self.pageViewController.view.transform = CGAffineTransformMakeRotation(-M_PI/30);
[self.pageViewController didMoveToParentViewController:self];
精彩评论