【发布时间】:2021-08-10 10:38:17
【问题描述】:
现在,我有标签栏图标的Lottie文件动画,但我不知道如何将它放在选择标签作为动画视图时。
有没有人可以帮助我或者只是指导我? 谢谢。
【问题讨论】:
标签: ios swift uitabbarcontroller uitabbar lottie
现在,我有标签栏图标的Lottie文件动画,但我不知道如何将它放在选择标签作为动画视图时。
有没有人可以帮助我或者只是指导我? 谢谢。
【问题讨论】:
标签: ios swift uitabbarcontroller uitabbar lottie
导入 Lottie 后创建这些函数:
func showLoadingAnimation(view: UIView) {
animationView.isHidden = false
animationView.animation = Animation.named("53175-ball-spinner")
animationView.frame = CGRect(x: 0, y: 0, width: 80, height: 80)
animationView.center = view.center
animationView.contentMode = .scaleAspectFill
animationView.loopMode = .loop
animationView.play()
view.addSubview(animationView)
}
func hideLoadingAnimation() {
animationView.stop()
animationView.isHidden = true
}
在需要的地方给他们打电话:
showLoadingAnimation(view: self.view)
【讨论】: