我的模式底板和软键盘之间有间隙。我正在使用 Jetpack compose 来构建 UI。有没有办法解决这个问题,因为我找不到任何解决方案

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)

我需要省略间隙。任何帮助将不胜感激。

wal*_*kmn 0

此问题在另一个库版本中已部分解决,请尝试使用新版本的material3库:

implementation 'androidx.compose.material3:material3-android:1.2.0-beta02'
Run Code Online (Sandbox Code Playgroud)