我有一个mpmovieplayercontroller顶部的小视图。当它不是全屏时,我可以将视图的框架调整到方向(当设备旋转时)。但是当我进入全屏模式时,尽管我设法呈现视图,但我无法在设备旋转时保持正确的帧。它看起来像全屏模式,系统只是在状态栏和moviePlayer上使用CGAffineTransformRotate。我如何应用这个CGAffineTransformRotate来正确旋转我的视图?iphone:在mpmovieplayercontroller中旋转?
编辑:
好了,我更新的代码在的MPMoviePlayerController的定向的改变后转动的X轴90%,但第一旋转之后的视图简单地消失。这里是我的代码:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
float angle = M_PI/2; //rotate 180°, or 1 π radians
theView.layer.transform = CATransform3DMakeRotation(angle, 1.0, 0.0, 0.0);
[self changePositionBasedOnOrientation:toInterfaceOrientation]; //here we change the frame of the view
}
这不是最好的方法,而是一种可能的方法。 – Till 2013-03-14 00:24:08