1

I am writing an application and have a structure similar to the following:

ScrollView {
    VStack {
        Button(action: {
            print("hello")
        }) {
           Text("Click Me")
        }
    }
}

When tapping the button, the action code runs properly, but there is no tap animation (i.e. the button does not fade out then fade back in). The fade animation only occurs if you tap and hold on the button.

How can I get this tap animation back? I have tried a number of things suggested in other threads (adding an onTapGesture to the ScrollView, etc.).

1
  • A similar issue was addressed in this answer (see the edit in second half of answer). Commented Dec 20, 2024 at 6:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.