how can i turn off the button highlighting in SwiftUI, when its tapped or pressed.
Here's my code:
ScrollView {
ForEach(searchManager.resultUsers) { user in
Button(action: {
self.showProfile = true
self.user = user
}) {
SearchUserRow(user: user)
.foregroundColor(.primary)
}
}
}.sheet(isPresented: $showProfile) {
ProfileView(profileUser: self.user)
.environmentObject(ProfileManager(userID: self.user.userID, fetchingMode: .user(mode: .tweets)))
}
if i remove the button and add onTapGesture to SearchUserRow not the complete row is selectable, only the content part.
.foregroundColor(.primary)directly on what you want to keep the color.