[英]Layout SwiftUI List cells from bottom upward
Is there a way to customize SwiftUI List so cells are displayed from bottom to top?有没有办法自定义 SwiftUI 列表,以便从下到上显示单元格?
Related question with UITableView: How to populate UITableView from the bottom upwards?与 UITableView 相关的问题: 如何从底部向上填充 UITableView?
struct FlipEffect: GeometryEffect {
func effectValue(size: CGSize) -> ProjectionTransform {
let t = CGAffineTransform(a: 1, b: 0, c: 0, d: -1, tx: 0, ty: size.height)
return ProjectionTransform(t)
}
}
struct ContentView: View {
var body: some View {
List(0..<100) { item in
Text("hello, world")
.modifier(FlipEffect())
}
.modifier(FlipEffect())
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.