URL of codelab
None
In which task and step of the codelab can this issue be found?
None
Describe the problem
At this chapter of the tutorial:
https://developer.android.com/codelabs/basic-android-kotlin-compose-calculate-tip?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%3Fhl%3Dzh-cn%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-calculate-tip#5
Where
"In the Switch composable, add this modifier to align the Switch composable to the end of the screen:"
Switch(
modifier = modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.End),
//...
)
should be:
Switch(
modifier = Modifier
.fillMaxWidth()
.wrapContentWidth(Alignment.End),
//...
)
Because the switch component is inside a row, and the modifier passed in is for the row component.
Invoke EditNumberField just passed a 32dp bottom padding, which will add redundant bottom padding to the switch component.
URL of codelab
None
In which task and step of the codelab can this issue be found?
None
Describe the problem
At this chapter of the tutorial:
https://developer.android.com/codelabs/basic-android-kotlin-compose-calculate-tip?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-2-pathway-3%3Fhl%3Dzh-cn%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-calculate-tip#5
Where
"In the Switch composable, add this modifier to align the Switch composable to the end of the screen:"
should be:
Because the switch component is inside a row, and the modifier passed in is for the row component.
Invoke
EditNumberFieldjust passed a 32dp bottom padding, which will add redundant bottom padding to the switch component.