Ran*_*mar 14 android android-jetpack-compose android-jetpack-compose-layout
我是按照官方文档来了解Rows的。
运行良好。它水平排列视图,应用程序运行没有任何问题。
问题:
我想在Row中设置horizontalArrangement。是没安排好。
我的代码:
@Composable
fun SimpleRowArrangement(){
Row(horizontalArrangement = Arrangement.SpaceEvenly,
verticalAlignment = Alignment.Bottom) {
Text(text = "Row Text 1")
Text(text = "Row Text 2")
Text(text = "Row Text 3")
}
}
Run Code Online (Sandbox Code Playgroud)
Gab*_*tti 37
您还应该应用修饰符fillMaxWidth。
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceEvenly,
verticalAlignment = Alignment.Bottom
) {
Text(text = "Row Text 1")
Text(text = "Row Text 2")
Text(text = "Row Text 3")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9291 次 |
| 最近记录: |