Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation Links Issue on ScrollView with SwiftUI

Tags:

swiftui

I have been using a ScrollView with a Vertical scroll instead of ListView with SwiftUI because of Customisation Limitations with ListView. I have found with Views Embedded in Such Scroll View along with Navigation Link, the icons or Images in such views are highlighted. This is happening on Xcode 11 beta 3 SwiftUI.

like image 956
Suryanarayan Sahu Avatar asked Jan 27 '23 02:01

Suryanarayan Sahu


2 Answers

I have the same issue this is my code

After navigation

If I Comment NavigationLink this will happen :


SOLUTION

After searching on web I found the solution

After NavigationLink add this line :

.buttonStyle(PlainButtonStyle())
like image 199
Sina Mirshafiei Avatar answered Feb 15 '23 11:02

Sina Mirshafiei


With SwiftUI with Buttons having Action handler we get a Default Blue icon. To avoid add an dafault Parameter .buttonStyle(.plain)

like image 22
Suryanarayan Sahu Avatar answered Feb 15 '23 12:02

Suryanarayan Sahu