2012-02-24 72 views
2

調整我的UIWebView(s)的速度很慢。調整多個UIWebView(大量內容)時,iPad2可能需要幾秒鐘的時間。這是我使用的代碼:我知道調整可以很快完成,因爲UIWebView調整緩慢

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

: - iPad上的海豚瀏覽器HD重新調整多個標籤很快全屏。 - 此外,當我調整大小時滾動UIWebView,調整大小很快完成。

如何快速調整UIWebViews的大小(就像在Dolphin HD瀏覽器中一樣)?有什麼竅門嗎?

感謝您的幫助!

+0

貴國是否能在調用的上下文的更多信息?似乎還有其他事情要做,爲什麼調整大小很慢..多一點代碼或更多的視覺會有所幫助。 – Jake 2012-02-24 13:01:30

+0

@notreallyJake感謝您的幫助。我更改了代碼。這就是我所做的一切。一個網頁在UIWebView – Gerben 2012-02-24 14:39:20

回答

0

您可以使用變換屬性,但內容也將被調整。

+0

加載的感謝幫助。你能舉一個例子(在代碼中)嗎? – Gerben 2012-02-24 14:43:55

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]; 
}  

}