有没有办法自定义 SwiftUI 列表,以便单元格从下到上显示?
与 UITableView 相关的问题:How to populate UITableView from the bottom upwards?
最佳答案
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())
}
}
关于ios - 从底部向上布局 SwiftUI 列表单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58099586/