如果我将某些内容推送到导航控制器然后弹回到主页,我的主页中的scrollview停止工作。如果我重新打开应用程序而不向导航控制器推送任何东西,它正常工作。滚动视图是延伸到框架外的水平滚动视图。我使用它来滚动浏览按钮,例如在iOS中切换应用程序(iOS多任务)。UIScrollView在将视图推送到UINavigationController后停止工作
这是我推一个新的VC
UIViewController *newVC = [[UIViewController alloc] init];
UILabel *label = [[UILabel alloc] initWithFrame:self.view.bounds];
[label setTextAlignment:NSTextAlignmentCenter];
label.text = [NSString stringWithFormat:@"promo %i detail view",[sender tag]];
label.backgroundColor = [UIColor whiteColor];
[newVC.view addSubview:label];
[self.navigationController setNavigationBarHidden:NO animated:NO];
[self.navigationController pushViewController:newVC animated:YES];
当视图控制器弹出,导航控制器回迁主页我隐藏的导航栏的代码。
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
if(viewController == self){
[self.navigationController setNavigationBarHidden:YES];
NSLog(@"%d", [self.scrollMenuBar isScrollEnabled]);
}
}
检查isScrollEnable返回true。
我试着推动一个普通的模态视图,并发生同样的问题。
还检查scrollView的内容大小,它保持不变。坡平 – Bonnie 2013-05-14 09:10:06
是之后,它仍然是相同的@Bonnie – harinsa 2013-05-14 09:14:01