Objective c UIViewController实现在rotate上未调用didRotateFromInterfaceOrientation时出现问题

Objective c UIViewController实现在rotate上未调用didRotateFromInterfaceOrientation时出现问题,objective-c,ipad,ios4,mpmovieplayer,Objective C,Ipad,Ios4,Mpmovieplayer,我已经实现了一个继承表单UIViewController的类。我使用xib编辑器创建标题栏和工具栏的纵向方向,当我旋转iPad时,它们会正确旋转。但是,我有一个MPMoviePlayerController,我想使用此方法手动调整其大小: -(void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { _mvp.view.frame = CGRectMake(_titleb

我已经实现了一个继承表单UIViewController的类。我使用xib编辑器创建标题栏和工具栏的纵向方向,当我旋转iPad时,它们会正确旋转。但是,我有一个MPMoviePlayerController,我想使用此方法手动调整其大小:

-(void) didRotateFromInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
    _mvp.view.frame = CGRectMake(_titlebar.frame.origin.x , _titlebar.frame.origin.y + _titlebar.frame.size.height , _titlebar.frame.size.width , super.view.frame.size.height  - 2* 44); 
    [_mvp stop];
}
_mvp是我的MPMoviePlayerController。我以前在应用程序中使用此方法调整大小,没有问题,所以我不明白为什么不调用此方法?(电影还在继续播放)我已经实现了shouldAutoRotateToInterfaceOrientation以返回YES-这是否会阻止它以任何方式运行


感谢

这可能是因为您的父控制器不会手动将方法调用从didRotateFromInterfaceOrientation传递给子控制器。如果您使用UINavigationController或uitabarcontroller作为您的父控制器,您应该查看一下

另外,请确保从所有子视图中为shouldAutorotateToInterfaceOrientation返回YES

假设您将shouldAutoRotateToInterfaceOrientation设置为返回YES,则不会阻止运行DidRotateFrominerFaceOrientation


希望这能有所帮助。

抱歉,在编写时意外地点击了return,它刚刚发布:)