![](/img/trans.png)
[英]Unable to change contentSize of UIScrollview in WKWebView
[英]Change UIScrollView contentSize with animation
是否可以使用動畫更改UIScrollView
的contentSize
,以便在特定時間段內縮小/增加大小,類似於
UIView.animateWithDuration(0.3, animations: {
scrollView.contentSize.width -= 100.0
}
不行。 我不知道有沒有辦法做到這一點?
嘗試transitionWithView
方法:
float newHeight = scroller.contentSize.height - someChangeFloat;
[UIView transitionWithView:scroller
duration:0.3f
options:UIViewAnimationOptionCurveEaseOut
animations:^{
scroller.contentSize = CGSizeMake(0, newHeight);
}
completion:^(BOOL finished){
}];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.