使用内置的DeleteButton
编辑列表时,是否可以指定删除按钮标题?
示例代码:
struct ExampleView: View {
@State
private var users = ["Paul", "Taylor", "Adele"]
var body: some View {
NavigationView {
List {
ForEach(users, id: \.self) { user in
Text(user)
}.onDelete(perform: delete)
}.navigationBarItems(trailing: EditButton())
}
}
func delete(source: IndexSet) { }
}
代码给出了(激活编辑时):
我想放置“ some_text”而不是“ Delete”-SwiftUI是否可以?另外,是否可以更改一行的删除标题?