
1 MX123 2022 年 6 月 30 日 scrollView |
2 InternetExplorer 2022 年 6 月 30 日 直接用个动画就好了吧 |
3 Building 2022 年 6 月 30 日 via iPhone superview.frame: screen.bounds imageview.frame: screen.bounds.insets(x: -50, y: 0).offset(x: 50, y: 0) uiview.animate(duration: 60) { imageview.frame = imageview.frame.offset(x: 50, y: 0) } |
4 Freeego 2022 年 6 月 30 日 scrollView 里放个 UIImageView ,动画块里更新 contentOffset |
5 chchengeng 2022 年 6 月 30 日 好奇 滚动完了 会停止吗。还是 会循环滚动啊? |
6 TOTOP OP @chchengeng 滚完了就进里面了,类似开机画面、启动页这种 |
7 365473321 2022 年 6 月 30 日 用 CADisplayLink 处理 frame 就行了 |
8 neptuno 2022 年 6 月 30 日 可以用 rive ,前段时间接触了一下,,各种动画都能做,还是很强大的 |
9 justin2018 2022 年 6 月 30 日 |
10 zjw7sky 2022 年 6 月 30 日 lottie 这个了解下 |
11 icebarley 2022 年 6 月 30 日 如果 swiftUI 开发的话原生代码就能实现 |
12 V2SuperUser 2022 年 7 月 1 日 ```swift import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let screenBounds = UIScreen.main.bounds let imageView = UIImageView(image: UIImage(named: "24110307_5")) view.addSubview(imageView) let imageW = screenBounds.width + 100 imageView.frame = CGRect(x: 0, y: 0, width: imageW, height: screenBounds.height) //方式 1 // UIView.animate(withDuration: 4) { // imageView.frame = CGRect(x: -100, y: 0, width: imageW, height: screenBounds.height) // } completion: { isFinished in // if isFinished{ // print("结束") // } // } //方式 2: let animation = CABasicAnimation() animation.keyPath = "transform.translation.x" animation.fromValue = 0 animation.toValue = -100 animation.duration = 4 animation.isRemovedOnCompletion= false animation.fillMode = .forwards imageView.layer.removeAllAnimations() imageView.layer.add(animation, forKey: nil) } } ``` |
13 neptuno 2022 年 7 月 1 日 @justin2018 是的,自己的 app 可以采用这种,真的能省很多时间 |