withAnimation(_:_:) 动画(SwiftUI中文文档手册)
程序员文章站
2022-03-16 16:13:09
...
withAnimation(:????
返回使用提供的动画重新计算视图主体的结果。
func withAnimation<Result>(_ animation: Animation? = .default, _ body: () throws -> Result) rethrows -> Result
讨论区
此函数将给定设置Animation为animation线程current 的属性Transaction。
实战代码
withAnimation(.spring()){
self.offset = .zero
}
技术交流
QQ:3365059189
SwiftUI技术交流QQ群:518696470
推荐阅读
-
overlay(_:alignment:) (SwiftUI中文文档手册)
-
accentColor(_:) (SwiftUI中文文档手册)
-
smarty3.0中文手册文档API及使用指南
-
smarty3.0中文手册文档API及使用指南
-
overlay(_:alignment:) (SwiftUI中文文档手册)
-
simultaneousGesture 手势(SwiftUI UIKit中文文档手册)
-
@GestureState (SwiftUI 中文文档手册)
-
withAnimation(_:_:) 动画(SwiftUI中文文档手册)
-
accentColor(_:) (SwiftUI中文文档手册)
-
PHP Redis中文手册下载_Redis中文API文档下载