本文介绍了键盘隐藏的TextFormField-Flutter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当重点放在TextFormField上时,键盘将隐藏在TextFormField上。我正在将SingleScrollview与Column小部件一起使用。下面我附上了带有编码的屏幕截图。请指导我解决此问题。
When focussing on the TextFormField, the keyboard hides over the TextFormField. I am using SingleScrollview with the Column widget. Below I attached a screenshot with coding. Please guide me in fixing this issue.
Scaffold(
resizeToAvoidBottomInset: false,
resizeToAvoidBottomPadding: false,
key: _scaffoldKey,
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: new Column(
children: <Widget>[
_tabText(),
isSignin ? _loginContainer() : _signUpContainer(),
],
),),),);
推荐答案
///将这行 resizeToAvoidBottomInset:true添加到脚手架中,并将主
//Add this line "resizeToAvoidBottomInset: true," to your Scaffold and put your main container in ScrollView.
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
key: _scaffoldKey,
backgroundColor: Colors.white,
body: SingleChildScrollView(
child: Container()
),
);
}
这篇关于键盘隐藏的TextFormField-Flutter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!