【发布时间】:2020-06-11 10:10:19
【问题描述】:
我已经看到这个问题被问了很多次,但没有一个解决方案对我有用。在下面的代码中,当单击bio 输入字段时,键盘会与该字段重叠。我尝试了resizeToAvoidBottomInset: true,有和没有SingleChildScrollView,但行为并没有改变。
Scaffold(
resizeToAvoidBottomInset: false,
appBar: ...
body: SingleChildScrollView(child:
Padding(
padding: const EdgeInsets.symmetric(horizontal: 110, vertical: 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(height: 40),
Text('Username'),
TextFormField(
controller: userName,
textAlign: TextAlign.left,
),
Text('Screen name'),
TextFormField(
controller: screenName,
textAlign: TextAlign.left,
),
Text('Bio'),
TextFormField(
controller: bio,
textAlign: TextAlign.left,
),
更新:
我创建了一个可以正常工作的空应用程序。所以代码似乎是正确的。我比较了AndroidManifest.xml。行是一样的:
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
有人知道有什么不同吗?
【问题讨论】:
标签: flutter