嗨,并提前感谢任何答复。旋转Ipad时动画视图过渡
我有一个iPad应用程序与两个不同的意见:一个肖像,一个景观。 当我旋转设备时,视图之间的转换不是很流畅。我想动画两个视图之间的转换,以便它看起来更好。 这是我的代码看起来像我的旋转:
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
if(toInterfaceOrientation == UIInterfaceOrientationLandscapeRight){
self.view = corePlotContent.view; //make graph the landscape view
self.view.transform = CGAffineTransformMakeRotation(deg2rad*(-360));
self.view.bounds = CGRectMake(0.0, 0.0, 1024.0, 748.0);
}else{
self.view = portraitView;
self.view.transform = CGAffineTransformMakeRotation(0);
self.view.bounds = CGRectMake(0.0, 0.0, 768.0, 1004.0);
}
}
我想我需要重写“willAnimateRotationToInterfaceOrientation”方法,并添加一些动画有,但我不知道如何编写代码。我之前没有动画,所以我没有取得任何进展。有人可以帮助我,谢谢!
感谢您的建议。我只是想知道如果我只是通过动画可以使转换更平滑,因为当横向视图弹出时,我会看到一些空白区域。 – serge2487 2011-03-17 20:24:14