Perhaps related to the above: in my app I am embed...
# compose-ios
t
Perhaps related to the above: in my app I am embedded a Compose view in iOS in the content area with a bottom tab bar. But in dark mode the bottom bar would always show as white. Using the layout inspector, you can see the SkikoUIView is larger than its parent UIViewController, which is what we create as the wrapper on the KMM side. See here (the red is the UIViewController created on KMM and its direct child is the Skiko view): I added the missing constraints to ensure they are the same size, like so (using SnapKit):
Copy code
if let skiko = child.view.subviews.first {
            skiko.snp.makeConstraints { make in
                make.edges.equalToSuperview()
            }
        }
and that cleared it up for me. Perhaps it will for you as well?
👍 1
g
I fixed it with the safe area option in swiftUI. Described the fix in the post above
t
Great. Though I think it is a bug that the Skiko view does not follow the size of its parent UIView...
g
It might be default behaviour for swiftUI too iirc
t
Perhaps. In my case above I am using only UIKit with child view controller, etc.
g
Yes just checked it's default behaviour
t
Sorry, just reread this. what are you saying is default SwiftUI behavior?
g
That there is a default safe area in swiftui too, so not much compose can do about it
d
I hope we already fix it in the commit: https://github.com/JetBrains/compose-multiplatform-core/pull/554 You can try to use a dev version: 1.5.0-dev1084
t
I was just able to get it running with 1.5.0-dev1084, and it does indeed fix the issue!! Thank you so much!
Also, another issue in that area of code:
Copy code
rootView.backgroundColor = UIColor.whiteColor
This will break in cases when in dark mode. For example, I have a segmented control with three different embedded Compose UIViewControllers. When switching between them they flash white. I have set them to be .clear and that has fixed the issue. But what you like want to do is one of the following: 1. Nothing: let the OS do the right thing 2. Set to .clear so it should not impact either way. 3. Set to .systemBackground, then at least it will likely match the default mode (but will still flash in any customized views)
d
Thanks for this report! We will try to fix it.