我有以下代码:
- (void)initAndStartTranslation:(NSURL *)movieURL
{
player = [[MPMoviePlayerController alloc] initWithContentURL: movieURL];
[self.view addSubview: player.view];
[player.view setFrame: self.view.bounds];
[player setControlStyle:MPMovieControlStyleFullscreen];
[player setInitialPlaybackTime: -1.0];
[player prepareToPlay];
[player play];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
[player.view setFrame: self.view.bounds];
}
播放器全屏,一切正常。但它在 (0,0) 坐标中旋转。我想在中心旋转它。我该怎么做?
我尝试设置锚点,也尝试设置它的中心:
[player.view setCenter:self.view.center];
但是没有任何变化:|。