我正在尝试实现此图像动画?
其自动输出和图像大小调整。有谁知道怎么做?
这是我的代码
/*
* Image resizing
*/
func scrollViewDidScroll(scrollView: UIScrollView) {
let top: CGFloat = scrollView.contentOffset.y
let newWidth: CGFloat = self.view.bounds.size.width
let new: CGFloat = 200 - top
if top >= -64 {
self.imageView.frame = CGRectMake(0, 0 - top, self.view.bounds.size.width, 220)
//imageView.si
}
if top < -64 {
var imgViewRect: CGRect = self.imageView.frame
imgViewRect.size.height = new
imgViewRect.size.width = newWidth - top
self.imageView.frame = CGRectMake(32 + (top / 2), 64, self.view.frame.size.width - (top + 64), imgViewRect.size.height - 44)
}
}