当 UIVeiwController 从 ios8 扩展显示时,ScrollsToTop 不起作用。但如果我们从应用程序内部呈现它,它就可以工作。任何人都可以帮忙吗?示例代码在这里共享。
UIScrollView * scrollview = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 300) ];
[scrollview setContentSize:CGSizeMake(320, 800)];
scrollview.layer.borderWidth = 1.0;
scrollview.backgroundColor =[UIColor redColor];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"slide1"]];
[scrollview addSubview:imageView];
scrollview.showsVerticalScrollIndicator =YES;
scrollview.scrollsToTop = YES;
scrollview.delegate = self;
UIViewController *a = [[UIViewController alloc] init];
a.view.backgroundColor = [UIColor greenColor];
[a.view addSubview:scrollview];
[self presentViewController:a animated:YES completion:^{
}];