Open joyzem opened 7 months ago
Hi, thanks for report. We currently didn't dig deep into SwiftUI layout mechanism so there is a chance that Representable
widget can't properly calculate its intrinsic size. Does the problem persist when you explicitly use .frame
modifier on it?
Thanks for the answer! I forgot to mention about .frame
modifier.. This helps, but suddenly the size of my composable is not static and it is useless in my case. By the way, Compose Multiplatform is great! I'm waiting for new releases and I have fully Compose Multiplatform app in App Store :)
That's nice to hear! I understand your use case. It sounds completely legit and we'll be looking into what we can do about it.
Any updates on this? We currently have to use the workaround suggested by John O'Reilly but that requires a lot of boilerplate code.
Still not, did you try experimenting with setting up a width NSLayoutConstraint manually on view of interop view controller and trying to figure out its height to pass to Compose using https://developer.apple.com/documentation/uikit/uiview/1622624-systemlayoutsizefittingsize?
Unfortunately, I don't quite understand the answer. Can you perhaps give me an example? If I understand it correctly, should I calculate the size in the Swift part and pass it through to the composable? But how is that supposed to work, because I need the intrinsic size of the composable and if I don't pass it through from the composable to the Swift part, it just seems to be 0.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Describe the bug When you use Compose Multiplatform though UIViewControllerRepresentable SwiftUI interop API, a composable function is not rendering if it is called inside the ScrollView
Affected platforms Select one of the platforms below:
Versions
To Reproduce Steps and/or the code snippet to reproduce the behavior:
Expected behavior Composable function should be rendered
Additional context The composable function is rendering without any problems when it is used inside VStack