Skip to content

How to preserve NavigationLink styling within List of buttons? #37

Answered by tgrapperon
rzulkoski asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @rzulkoski! This is indeed something lacking with the current official API's. It is relatively straightforward to build something that will look like a NavigationLink with a chevron at rest, using Brandon's trick, or an explicit ButtonStyle. It is however very tricky to produce something that behaves idiomatically.

My most promising results were obtained doing the opposite of Brandon's suggestion, that is putting a Button in the NavigationLink's Label. I've posted them in the form of a self-contained gist. This is relatively hackish, but so is this ButtonStyle approach from earlier this year or more recently. In both cases, it works reliably only on iOS, as we're able to introspect th…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@tgrapperon
Comment options

@rzulkoski
Comment options

Answer selected by rzulkoski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants