I am following this YouTube Tutorial where they are using Modifier.preferredSize()
on a box and Modifier.preferredHeight()
on a Spacer Composable - all other chained Modifiers are fine.
However Android Studio is not recognizing these 2 options.
Here is the code that I am working with:
I am using compose_version = '1.0.1'
and I'm on AS Arctic Fox
preferredSize
was renamed to size
and preferredHeight
to height
If I face some old video/article with invalid api, I'm searching through compose-samples(official samples from the maintainers) commits to find place where this method was deprecated/renamed, it's the easiest way to know if it just was renamed or I need to change more logic. In this case change was on this commit
Modifier.preferredWidth/preferredHeight/preferredSize
were renamed to width/height/size
starting from 1.0.0-beta01
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With