SwiftUI .popover body dimension incorrect


In iOS 16.4 we are able to now use .presentationCompactAdaptation(.none) in our .popover to attain a real popover on iOS (compact display sizes).

SomeView()
    .popover(isPresented: $isPopoverOpen) {
        Textual content("Hiya world!")
            .fixedSize(horizontal: false, vertical: true)
            .padding()
            .presentationCompactAdaptation(.none)
    }

This may give us one thing like:

enter image description here

Nice, it really works as anticipated!

The problem arises when the Textual content() within the popover spans a number of strains. For some motive, the popover peak will solely develop as much as a sure peak (~3 strains with non-dynamic .physique font). Right here is an illustration of the problem utilizing some Lorem Ipsum textual content. Discover how the top will get clipped off as a result of the popover peak is just too brief:

enter image description here

How can I make the popover match the Textual content() content material? I can statically outline the peak however I would really like the popover to completely match the content material.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles