Join Slack
Powered by
Do I need to import something in order to use Modi...
# compose
a
Anita
11/02/2020, 6:51 AM
Do I need to import something in order to use Modifier.weight()? I'm using alpha06
h
Hitanshu Dhawan
11/02/2020, 10:13 AM
No, you don’t have to import anything. Make sure you are using it at right place like in Row or Column
➕ 2
a
Anita
11/02/2020, 7:33 PM
https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/29a1ce7409f7fe0d2b48a049c2834b926787c2f6/app/src/main/java/com/example/jetpackcompose/layout/ViewLayoutConfigurationsActivity.kt#L130
but here they use it on a Button.
h
Hitanshu Dhawan
11/02/2020, 8:25 PM
Here, the Button is inside the
Row
composable (Line no. 122) So,
Modifier.weight()
is used here from
RowScope
Open in Slack
Previous
Next