即使我将 shouldAutoRotate 设置为 false,我也有一个正在旋转的视图 (InfoVC)。这是打开视图的代码(在模态中)
- (IBAction)presentInfoVC:(id)sender{
InfoVC *infoVC = [[InfoVC alloc] init];
UINavigationController *infoNVC = [[UINavigationController alloc] initWithRootViewController:infoVC];
UIImage *img =[UIImage imageNamed:@"image.png"];
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
infoNVC.navigationBar.tintColor = [UIColor lightGrayColor];
[infoNVC.navigationBar.topItem setTitleView:imgView];
[imgView release];
[self presentModalViewController:infoNVC animated:YES];
[infoVC release];
}
以及应该避免此视图旋转的代码(在 InfoVC.m 中):
- (BOOL)shouldAutorotate
{
return FALSE;
}
怎么了?
问候!