【发布时间】:2011-04-03 09:00:40
【问题描述】:
我在 mpmovieplayercontroller 顶部有一个小视图。当它不是全屏时,我可以将视图的框架调整为方向(当设备旋转时)。但是当我进入全屏模式时,虽然我设法呈现视图,但当设备旋转时我不再能够保持正确的帧。看起来在全屏模式下,系统只是在状态栏和电影播放器上使用 CGAffineTransformRotate。如何应用此 CGAffineTransformRotate 来正确旋转我的视图?
编辑:
好的,所以我更新了代码,以便在改变 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
}
【问题讨论】:
标签: iphone ipad rotation mpmovieplayercontroller cgaffinetransform