UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Menu buttons view difference on iOS and Mac (designed for iPad)

Forums > SwiftUI

@MaxAL  

Dear Community,

Need your help. Building iOS App, trying to solve Menu view differences. By default iOS App is compatable with Mac, if app designed for iPad.

One issue I've encountered is that icons on menu buttons are automatically removed on Mac, resulting in inconsistency between the two platforms.

Menu on iPhone and iPad

Menu on Mac

Is there a way to retain icons on menu buttons on Mac within an iOS app? I would greatly appreciate any advice or solutions you can offer.

Thank you for your help.

Example code:

Menu {
            Button {
                //action here
            } label: {
                Label("first button", systemImage: "lock")
            }
            Button {
                //action here
            } label: {
                Text("second button")
                Spacer()
                Image(systemName: "eraser.fill")
            }
       } label: {
            Label("PDF", systemImage: "doc.fill")
       }

Any suggestion?

   

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.