我的代码如下。
// 模态底部表单状态
val modalBottomSheetState = rememberModalBottomSheetState(
skipPartiallyExpanded = true
)
Run Code Online (Sandbox Code Playgroud)
//来自基本文本字段的自定义 OTP 字段。
CustomOtpField(
text = accessPin,
onTextChanged = {
if (it.isEmpty()) accessPin = it
it.lastOrNull()?.let { mChar ->
if (!(mChar == '.' || mChar == ' ')) {
if (it.length <= 4) {
accessPin = it
}
}
}
},
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Number,
imeAction = ImeAction.Done
)
)
Run Code Online (Sandbox Code Playgroud)
我需要省略间隙。任何帮助将不胜感激。
android kotlin android-jetpack-compose jetpack-compose-modalbottomsheet
我的底页有以下代码。
val skipPartiallyExpanded by remember {
mutableStateOf(true)
}
val bottomSheetState =
rememberModalBottomSheetState(skipPartiallyExpanded = skipPartiallyExpanded)
ModalBottomSheet(
onDismissRequest = {
onDismissRequest()
onSearchTextChange("")
},
sheetState = bottomSheetState,
)
Run Code Online (Sandbox Code Playgroud)
我希望始终保持底部工作表展开,但每当内容变小时它就会变小。我认为设置skipPartiallyExpanded为 true 可以解决问题,但它并没有像我预期的那样工作。