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

SOLVED: Popover style

Forums > SwiftUI

I've implemented a popover and it works fine. However, the style is really weird and looks more like a sheet than a popover.

Screen recording here: https://drive.google.com/file/d/1F02E6YeX_1wUACOU1w11wcqFQJG-h1GF/view?usp=sharing

This is the part of my code with the popover:

Button( action: {
                self.showPopover = true
}){
    Image(systemName: "plus")
        .foregroundColor(Color("gray.dark"))
    }
}.popover(isPresented: self.$showPopover)
                {
                    Picker(selection: $selectedColor, label: Text("Custom duration")) {
                                ForEach(0 ..< colors.count) {
                                   Text(self.colors[$0])
                                }
                             }.background(Color.red)
                    .opacity(0.75)
                    .frame(width: 250, height: 150)
                    .cornerRadius(32)
                }

I just want to see the red part. How can I change this?

2      

Like many things in SwiftUI, popover displays differently depending on the platform. On iOS, it presents as a sheet.

2      

TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!

Find out more

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

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.