在显示另一个视图滚动停止滚动后,我在主视图上有一个滚动视图。
在视图中出现我试图刷新滚动但没有运气
调用这个:
-(void)refreshScrollView{
NSLog(@"scroll Content Height %f",answerScolledHeight );
NSLog(@"scroll View Height %f", scrollView1.frame.size.height );
[scrollView1 setScrollEnabled:YES];
[scrollView1 setContentSize:CGSizeMake(320, answerScolledHeight)];
[scrollView1 setContentOffset:CGPointMake(0, 0)];
}
它在不工作的情况下读取正确的值:
2013-03-21 17:56:01.434 ----[38464:14003] scroll Content Height 256.000000
2013-03-21 17:56:01.434 ----[38464:14003] scroll View Height 194.000000
问题出现在设置视图的显示之后:
SettingsController* controller1 = (SettingsController *)[self getSettingsViewController];
[self presentModalViewController:controller1 animated:YES];
当设置关闭时,滚动不再起作用
- (IBAction)doClose:(UIBarButtonItem *)sender {
[self dismissModalViewControllerAnimated:YES];
}
viewDidAppear,我第一次尝试运行一些命令来限制问题,因为我正在使用 ECslidingViewController(擦除菜单)
- (void)viewDidAppear:(BOOL)animated{
if (!isActive){
answerUpY = self.answerView.frame.origin.y;
answerDownY = self.questionBackground.frame.origin.y +self.questionBackground.frame.size.height - self.answerToggle.frame.size.height - PADDING_1;
isActive = TRUE;
[self slidingControllerAppear];
}else{
[self refreshScrollView];
}
}