- 我在 jetpack compose 中有一个惰性文本字段列表(大约 10 个 OutlineTextField())
- 最后几个文本字段被键盘隐藏
- 如何在键盘上方移动那些较低的文本字段?谢谢
问问题
675 次
2 回答
0
以您的活动使用的样式将其添加到主题.xml:
调整大小|状态可见
或 android:windowSoftInputMode="adjustResize" 在您的清单中包含您的列表的活动
于 2021-05-18T15:48:01.993 回答
0
您需要实现accompanist-insets
依赖项
implementation "com.google.accompanist:accompanist-insets:<version>"
// If using insets-ui
implementation "com.google.accompanist:accompanist-insets-ui:<version>"
然后ProvideWindowInsets(windowInsetsAnimationsEnabled = true)
在 MainActivity 中使用如下代码所示。
setContent {
ProvideWindowInsets(windowInsetsAnimationsEnabled = true) {
MyApplicationTestTheme {
//your content goes here
}
}
}
有关更多详细信息,请查看文档
于 2021-09-05T21:35:16.997 回答