Great!!Inspired by your answers, I find that ".buttonStyle(BorderlessButtonStyle())" is the key point. If I apply it to Button view in my code above. The action block indeed works! But I can't get the reason. In addition, how could I prevent the onTapGesture block from working for Button? In other words, how could I make action block work only(mask the onTapGesture block )?
Post
Replies
Boosts
Views
Activity
I have tried 4 methods above one by one:
Disabling "Connect Hardware Keyboard" seems only to affect the behavior of simulators, but not the canvas.
I switch to different simulators, include iPhone & iPad. But the problem is still there.
I add a new swiftui view and make it to have the simplest code. But it is still no go.
struct TextFieldPopupView: View { @State private var text = "" var body: some View { TextField("Hello", text: $text) .textFieldStyle(RoundedBorderTextFieldStyle()) } } struct TextFieldPopupView_Previews: PreviewProvider { static var previews: some View { TextFieldPopupView() } }
4. Removing derived data has no effect yet.
Thank you all the same.