我有两个视图"A"和"B".在窗口中间浮动(它不是全屏).B,将取代A的视图是全屏.我想编写一个自定义过渡,翻转A以显示背面的B,但同时缩放翻转矩形,以便在翻转完成时,B为全屏.
toView:持续时间:选择:我已经使用可用transitionFromView翻转过渡试图完成,但我只能把它翻转而不是以A开头的框架翻转,并与B的帧结束了整个屏幕.
我知道我可以对视图的图层进行类似3D的转换,但我不确定应该使用哪组动画API来完成此操作.有一两件事我想是在transitionWithView的动画块修改视图的图层属性:持续时间:选择:动画:完成:但没有工作,因为它似乎只兑现视图属性修改.
有人能指出我正确的方向吗?我非常感激.
更新:到目前为止,这是我的代码.您可以在此处观看视频:http://www.youtube.com/watch?v = -xNMD2fGRwg
CGRect frame = [[UIApplication easybookDelegate] rootViewController].view.bounds ;
float statusHeight = [UIApplication sharedApplication].statusBarFrame.size.height ;
frame.origin.y = statusHeight ;
frame.size.height -= statusHeight ;
self.view.frame = frame ; // self.view is view "B"
// Put the snapshot as thet topmost view of our view
UIImageView *imageView = [[UIImageView alloc] initWithImage:image] ; // image is a snapshot of view "A"
imageView.frame = self.view.bounds ;
[self.view addSubview:imageView] ;
[self.view bringSubviewToFront:imageView] ;
// Pre-transform our view …Run Code Online (Sandbox Code Playgroud)