gpt4 book ai didi

flutter - 键盘出现时如何避免 flutter 的页面向上滚动

转载 作者:IT王子 更新时间:2023-10-29 06:47:50 24 4
gpt4 key购买 nike

我想从这些 TextField 中获取输入。当我聚焦 TextField 时,键盘出现并且页面向上滚动。我不需要那个滚动。我怎样才能避免这种情况?

Normal View

After TextField Focusing

最佳答案

使用

Scaffold(
resizeToAvoidBottomInset: false,
...
)

来自文档:

For example, if there is an onscreen keyboard displayed above the scaffold, the body can be resized to avoid overlapping the keyboard, which prevents widgets inside the body from being obscured by the keyboard.

关于flutter - 键盘出现时如何避免 flutter 的页面向上滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57605917/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com