1

我使用以下代码从我的 mainScreen 调用视图控制器:

VisualizarFotoViewController *visualizarFoto = [self.storyboard instantiateViewControllerWithIdentifier:@"VisualizarFoto"];
[self presentViewController:visualizarFoto animated:NO completion:^{
    [UIImageView animateWithDuration:0.5 animations:^{
        visualizarFoto.visualizarFoto.contentMode = UIViewContentModeScaleAspectFit;
        visualizarFoto.visualizarFoto.image = _fotoPrincipal.image;
        visualizarFoto.viewPrincipal.alpha = 1;
        visualizarFoto.telaOrigem = 2;

    }];
}];

要回到 mainScreen,我使用以下代码关闭视图控制器:

[UIImageView animateWithDuration:0.2 animations:^{
    _viewPrincipal.alpha = 0;
} completion:^(BOOL finished) {
    [self dismissViewControllerAnimated:NO completion:nil];
}];

我的问题是当我回到主屏幕时,我的滚动视图不响应任何滚动手势。我尝试[_scrollView becomeFirstResponder]viewDidAppearsection 中使用,但没有成功。你有什么提示可以解决这个问题吗?谢谢

4

1 回答 1

4

如果有人在寻找答案,这就是我为解决此问题所做的工作:

- (void)viewDidLayoutSubviews {
    // Define the scrollview size accordingly with the number of pages
    [_scrollView setFrame:CGRectMake(0, 43, 320, 450)];
    [_scrollView setContentSize:CGSizeMake(320 * 3, 450)];
}
于 2013-05-23T14:52:26.617 回答