HomeiOS DevelopmentSwiftUI .popover body dimension incorrect

SwiftUI .popover body dimension incorrect


In iOS 16.4 we will now use .presentationCompactAdaptation(.none) in our .popover to realize a real popover on iOS (compact display screen sizes).

SomeView()
    .popover(isPresented: $isPopoverOpen) {
        Textual content("Whats up 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 difficulty arises when the Textual content() within the popover spans a number of strains. For some purpose, the popover top will solely develop as much as a sure top (~3 strains with non-dynamic .physique font). Right here is an illustration of the difficulty utilizing some Lorem Ipsum textual content. Discover how the tip will get clipped off as a result of the popover top 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

Most Popular

Recent Comments