Cli*_*res 9 android kotlin android-jetpack-compose jetpack-compose-modalbottomsheet
我的代码如下。
// 模态底部表单状态
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)
我需要省略间隙。任何帮助将不胜感激。
此问题在另一个库版本中已部分解决,请尝试使用新版本的material3库:
implementation 'androidx.compose.material3:material3-android:1.2.0-beta02'
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
848 次 |
| 最近记录: |