当前位置:网站首页>The problem of automatic page refresh after the flyer WebView pops up the soft keyboard

The problem of automatic page refresh after the flyer WebView pops up the soft keyboard

2022-06-25 09:44:00 Moon Spring

flutter About the problem caused by soft keyboard bounce

1. When the layout height is dead , For example, set to screen height , When the keyboard pops up, the layout will appear on the page overflow A hint of
2. The input box is blocked after the soft keyboard pops up
reason : stay flutter in , The system will shrink when the keyboard pops up Scaffold And rebuild

solve the problem 1 in overflow Two ways to prompt :
1) hold Scaffold Of resizeToAvoidBottomInset Property is set to false, This will not... When the keyboard pops up resize

2) Change the writing height to Original height - MediaQuery.of(context).viewInsets.bottom, The layout will be rebuilt when the keyboard pops up , And this MediaQuery.of(context).viewInsets.bottom The variable is before the keyboard pops up 0, When the keyboard pops up, it is the height of the keyboard

solve the problem 2 The way to :
Place the input field in a scrollable Widget Then you can , When the input box gets focus , The system will automatically slide it to the visible area

author : Xiao Ji, run
link :https://www.jianshu.com/p/4dab8a87f28b
source : Simple books

原网站

版权声明
本文为[Moon Spring]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200549005956.html

随机推荐