我有以下代码,但似乎无法删除 TabView 底部的点。
struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
@State var users = ["Janice", "Emily", "Candice", "London", "Julia"]
var body: some View {
TabView {
ForEach(users, id: \.self) { user in
UserCard(user: user)
}
}
.tabViewStyle(PageTabViewStyle())
.indexViewStyle(PageIndexViewStyle(backgroundDisplayMode: .never))
.background(Color(.systemGroupedBackground))
}
}
struct UserCard: View {
let user: String
var body: some View {
Color.white
.padding(30)
}
}
我原以为 PageIndexViewStyle(backgroundDisplayMode: .never) 会删除索引点,但这不起作用。有没有其他方法可以摆脱它们?