首页 文章

UIWebView调整速度很慢

提问于
浏览
2

调整UIWebView的大小很慢 . 调整多个UIWebView(大内容)的大小时,iPad2上可能需要几秒钟 . 这是我使用的代码:

tmpUIWebView.frame = CGRectMake(0, 0, 768, 1004);

我知道调整大小可以很快完成,因为: - iPad上的Dolphin HD浏览器可以非常快速地将多个选项卡调整为全屏 . - 此外,当我在调整大小时滚动UIWebView时,调整大小很快就完成了 .

如何快速调整UIWebViews的大小(就像在Dolphin HD浏览器中一样)?有什么诡计吗?

谢谢你的帮助!

2 回答

  • 1

    这就是我慢慢隐藏视图的方式

    - (void)hideLoadinNotification{
    
    [UIView beginAnimations:@"fadeOut" context:NULL];
    [UIView setAnimationDuration:0.25]; 
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
    infoView.transform = CGAffineTransformMakeScale(1, 0.5);
    [UIView commitAnimations];
    }
    - (void)showLoadinNotification{
    [infoView setNeedsLayout];
    
    [UIView beginAnimations:@"fadeIn" context:NULL];
    [UIView setAnimationDuration:0.25]; 
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
    infoView.transform = CGAffineTransformMakeScale(1, 1);
    [UIView commitAnimations];
    }
    - (void)animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context{
    if ([animationID isEqual:@"fadeOut"]) {
        [infoView removeFromSuperview];
    }    
    if ([animationID isEqual:@"fadeIn"]) {
        [self.tableView addSubview:infoView];
    }    
    
    }
    
  • 0

    您可以使用transform属性,但也会调整内容的大小 .

相关问题