I have the same problem placing a toolbarItem in TextEditor. Also need it to work on iOS 15, so I cannot use NavigationStack. Any workaround?
TextEditor(text: $text)
.padding(.all)
.padding(.vertical, -8)
.padding(.horizontal, -5)
.focused($focusedField, equals: .textArea)
.toolbar {
ToolbarItem(placement: .keyboard) {
HStack{
Spacer()
Button("_done") {
focusedField = nil
}
}
}
}
.disabled(disabled)
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: