11.7_如何创建非对称转换

SwiftUI 允许我们在添加视图时指定一个转换,在删除视图时指定另一个转换,所有转换都使用 asymmetric() 转换类型完成。

例如,我们可以创建一个使用非对称过渡的文本视图,以便在添加时从前缘移入,并在移除时向下移动到底边,如下所示:

Text("Details go here.").transition(.asymmetric(insertion: .move(edge: .leading), removal: .move(edge: .bottom)))
Avatar
M X
Mobile, Front-End Developer

My research interests include swift developing, python developing and go developing.

Related

Next
Previous
comments powered by Disqus