I'm an android developer in my kmp project I need the screen size :
expect object ScreenSize {
val heightDp: Float
}
in android platform i implemented it like this :
actual object ScreenSize {
actual val heightDp: Float
get() = Resources.getSystem().displayMetrics.run { heightPixels / density }
}
in ios platform :
actual object ScreenSize {
actual val heightDp: Float
get() = UIScreen.mainScreen.bounds.size.height.toFloat
}
as i searched the above code should work but the .height is not known and is red and i can't get the width/height from the UIScreen.mainScreen.bounds.size