2011-05-03 28 views
5

我想知道是否有一種方法來動畫UIWebView的大小和位置。 如果我折騰這樣的:UIWebView和動畫

[UIView animateWithDuration:1.0 animations:^{ 
    self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); 
}]; 

[UIView beginAnimations:@"zoomIn" context:nil]; 
[UIView setAnimationDuration:2.75]; 
[UIView setAnimationDelegate: self]; 

    self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); 

[UIView commitAnimations]; 

同時有一個灰色的框做動畫, 的web視圖的內容瞬間切換到新的大小沒有動畫。 (scalesPageToFit屬性設置爲YES)

有什麼建議嗎?

回答

2

尚未破解文本寬度的即時更改,但可以通過以編程方式將UIWebView的背景更改爲clearColor來擺脫灰色框。出於某種原因,如果您通過Interface Builder執行此操作,則不起作用。