
我的应用程序可以在肖像模式下正确启动,效果很好,但在我的应用程序中,一些视图仅支持横向模式,而一些视图同时支持横向和纵向,当我将应用程序视图从仅支持横向切换到支持两种方向的视图并将设备旋转到纵向并按下返回按钮时,横向视图不会自动旋转
我使用以下代码来设置方向
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}谢谢
发布于 2014-01-08 23:15:12
编辑这些行
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}作为
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (toInterfaceOrientation == UIInterfaceOrientationMaskLandscapeLeft) {
return YES;
}
else {
return NO;
}
}https://stackoverflow.com/questions/20999023
复制相似问题