|
In the example code below I'd like to the word Delete and the trash SF symbol to be red, but no matter what I try it's either black in light mode, or white in dark mode.
Is it possible to set the colour of menu items? If so, how? Thanks Gavin |
|
From what I have read and understood, as of right now this is not possible in SwiftUI and you would have to use UIKit instead. Here is an article, from Jan 2020, and although it is talking about iOS13, I think that it is still current and relevant now. Context Menus I did play around with your sample code to try out various things( ButtonStyle, MenuStyle, makeBody, Configuration), until I found the article above.
|
|
|
|
This is now possible in iOS 15 by setting a Button's role.
|
|
|
|
Have you updated to Xcode 13.2.1 (currently the latest version), as the button role are working for me in iOS 15.2.
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.