【发布时间】:2022-11-28 23:38:03
【问题描述】:
我希望包含按钮和文本的行的宽度与文本字段的宽度相同。这是我尝试过的:
Column(
modifier = Modifier.fillMaxSize().padding(padding),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
TextField(
value = email,
onValueChange = { email = it },
placeholder = {Text(text = "Email")}
)
TextField(
value = password,
onValueChange = { password = it },
placeholder = {Text(text = "Pass")}
)
Row {
Button(
onClick = {
start(email, password)
}
) {
Text(
text = "Start",
fontSize = 18.sp
)
}
Spacer(
modifier = Modifier.weight(1f)
)
Text(
text = "Skip"
)
}
}
这就是我得到的:
这就是我所期望的:
我可以在不设置固定尺寸的情况下实现吗?