- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我在 flutter 中使用带有选项卡的 TabBarView。我的标签栏 View 包含输入表单。现在当键盘打开时小部件溢出
我尝试使用 Listview 和 SingleChildScrollView 来避免这个问题,但它对我不起作用。使用 ListView 或 SingleChildScrollView 时,屏幕变为空白。
@override
Widget build(BuildContext context) {
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
return new Scaffold(
resizeToAvoidBottomPadding: true,
body: SafeArea(
child: DefaultTabController(
length: 2,
child: Column(
children: <Widget>[
Expanded(
flex: 0,
child: TabBar(
tabs: [
Tab(text: 'Sign In'),
Tab(text: 'Sign Up'),
],
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: Colors.grey,
indicatorPadding: const EdgeInsets.symmetric(horizontal: 16.0),
labelPadding: const EdgeInsets.symmetric(vertical: 4.0),
),
),
Expanded(
flex: 1,
child: TabBarView(
children: [_buildSignInForm(), _buildSignupForm()]),
)
],
),
),
),
backgroundColor: Colors.white,
);
}
最佳答案
将您的 Column
包裹在 Container
小部件中,并通过以下方式设置高度以匹配屏幕高度:
`height: MediaQuery.of(context).size.height,`
关于flutter - 软键盘打开时小部件溢出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54655803/
我是一名优秀的程序员,十分优秀!