5

I have the problem that I can't get the popover view of a Button to fit the size of its content.

Here's what the problem looks like

enter image description here

And the Code:

Button(action: {
    self.showColorDropDownMenu.toggle()
}, label: {
    Circle()
        .fill(Color.red)
        .frame(width: 22, height: 22)
}).popover(isPresented: self.$showColorDropDownMenu) {
    Text("Hello").background(Color.yellow)
}

I tried calling .frame(...) with different arguments, but it doesn't seem to work on iPadOS

I saw another question here on SO, which talks about the same issue, but I can't comment, yet, so I can't ask if they found a solution and maybe there's another fix to it.

Sheldon
  • 376
  • 3
  • 14
  • 1
    Does not seem like it’s currently possible to change the frame of a popover. I created bug report FB7465491, I suggest doing the same. – abellao Nov 25 '19 at 00:23

1 Answers1

3

This has been fixed in iOS 13.4, the popover fits to the size of its contents now.

choxi
  • 455
  • 4
  • 18