Iphone SetStatusBaroOrientation不工作
我试图将状态栏的方向改为纵向,但没有成功。我试过:Iphone SetStatusBaroOrientation不工作,iphone,statusbar,Iphone,Statusbar,我试图将状态栏的方向改为纵向,但没有成功。我试过: [application setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO]; 而且shouldAutorotateToInterfaceOrientation设置为返回NO 请帮助我。如果您想在显示特定视图时更改方向,您应该在[UIViewController ViewWillAspect:]中调用[UIApplication setStatusBarOr
[application setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
而且
shouldAutorotateToInterfaceOrientation
设置为返回NO
请帮助我。如果您想在显示特定视图时更改方向,您应该在[UIViewController ViewWillAspect:]中调用[UIApplication setStatusBarOrientation:animated:]覆盖方法,以覆盖每个强制特定方向的视图控制器。当视图被推到堆栈上或从堆栈中弹出时,这将导致更改。确保在覆盖方法中调用super 还要更改您的shouldAutorotateToInterfaceOrientation方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
shouldAutorotateToInterfaceOrientation
应将YES
返回到viewController支持的方向,如果每个方向都不正确,则返回NO
。如果支持纵向,则如果方向为纵向,则返回YES
。