Hello, How to fix this line(refer image) issue be...
# compose-ios
h
Hello, How to fix this line(refer image) issue between statusbar and scaffold? iOSMain:
Copy code
@Composable
actual fun StatusBarColors(
    statusBarColor: Color,
    navBarColor: Color,
) {
    val statusBar = statusBarView()
    SideEffect {
        statusBar.backgroundColor = statusBarColor.toUIColor()
        UINavigationBar.appearance().backgroundColor = navBarColor.toUIColor()
    }
}

@OptIn(ExperimentalForeignApi::class)
@Composable
private fun statusBarView() = remember {
    val keyWindow: UIWindow? =
        UIApplication.sharedApplication.windows.firstOrNull { (it as? UIWindow)?.isKeyWindow() == true } as? UIWindow
    val tag =
        3848245L 
    keyWindow?.viewWithTag(tag) ?: run {
        val height =
            keyWindow?.windowScene?.statusBarManager?.statusBarFrame ?: zeroValue<CGRect>()
        val statusBarView = UIView(frame = height)
        statusBarView.tag = tag
        statusBarView.layer.zPosition = 999999.0
        keyWindow?.addSubview(statusBarView)
        statusBarView
    }
}
m
If you give your main App composable a Color.Blue background, is the line blue? It looks to me like there is somewhere a padding specified leading to this line..
j
Could you send me your ContentView.swift please? I think it could be related to:
.ignoresSafeArea(edges: .all)
1