我有一个这样的Expanded小部件列:
return new Container(
child: new Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
new Expanded(
flex: 1,
child: convertFrom,
),
new Expanded(
flex: 1,
child: convertTo,
),
new Expanded(
flex: 1,
child: description,
),
],
),
);
Run Code Online (Sandbox Code Playgroud)
convertFrom,包括TextField.当我点击此文本字段时,Android键盘将出现在屏幕上.这会更改屏幕大小,因此小部件会像这样调整大小:

有没有办法让键盘"覆盖"屏幕,以便我的列不调整大小?如果我不使用Expanded小部件并为每个小部件硬编码高度,则小部件不会调整大小,但是当键盘出现时(因为没有足够的空间),我会收到黑黄条纹错误.对于所有屏幕尺寸,这也不灵活.
我不确定这是特定于Android还是特定于Flutter.
当我选择文本字段时,将显示键盘,但键盘隐藏我选择的TextField.有人有解决方案吗?
谢谢.
For some reason after updating flutter, one of the sections of my app has been broken. I have a list of text form widgets set in a SingleChildScrollView. Whenever I press one of the text forms, the keyboard appears and an empty white box pushes itself up into the field of view, obscuring the text entry boxes.
After having some trouble with text entry in a list view before I followed the advice of this link: https://www.didierboelens.com/2018/04/hint-4-ensure-a-textfield-or-textformfield-is-visible-in-the-viewport-when-has-the-focus/
It effectively solved …
当焦点位于 TextField 上时,键盘会隐藏在 TextField 上方。下面我附上了带有代码的屏幕截图。请指导我解决这个问题。
注册.dart
import 'package:flutter/material.dart';
import 'package:yfobs/utilities/desc.dart';
class SignUpPage extends StatefulWidget {
static String tag = 'SignUpPage';
@override
_SignUpPageState createState() => _SignUpPageState();
}
class _SignUpPageState extends State<SignUpPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomPadding: false,
body: Container(
width: double.infinity,
decoration: BoxDecoration(
gradient: LinearGradient(begin: Alignment.topCenter, colors: [
Color(0xFF832685),
Color(0xFFC81379),
])),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 80,
),
Padding(
padding: EdgeInsets.only(top: 0, bottom: 20, left: 20, right: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ …Run Code Online (Sandbox Code Playgroud)