我如何解释似乎为Android导航栏重新存储的空白空间?

问题描述 投票:-1回答:1

我正在快速建立一个RegisterPage,并将支架分成两个容器。一个用于上半部,另一个用于下半部,以便徽标/标题可以位于上半部,而表单可以位于下半部。

现在,我在android上测试后注意到键盘与输入字段重叠。 o我添加了单个子滚动视图来解决此问题。但有一个问题。内容似乎太大,即使键盘按下,您现在也可以随时滚动。我也添加了一个视频演示。

我认为这是对此负责的原因>

enter image description here

似乎该空间已为android导航栏保留。我该如何删除?或如何以这种方式确定容器的大小,以便它们能解决这个问题?

  @override
  Widget build(BuildContext context) {
    final AuthenticationProvider authenticationProvider = Provider.of<AuthenticationProvider>(context);
    return Scaffold(
      backgroundColor: Theme.of(context).backgroundColor,
      body: Center(
        child: ScrollConfiguration(
          behavior: ScrollBehaviourWithoutGlow(),
          child: SingleChildScrollView(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              mainAxisSize: MainAxisSize.max,
              children: [
                Container(
                  decoration: BoxDecoration(color: Colors.red),
                  height: MediaQuery.of(context).size.height / 2,
                  child: _buildLogo(),
                ),
                Container(
                  decoration: BoxDecoration(color: Colors.green),
                  height: MediaQuery.of(context).size.height / 2,
                  child: _buildRegisterForm(authenticationProvider),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }

由于此帖子没有任何答案,我决定上传视频以显示我的意思。这是视频

https://www.youtube.com/watch?v=Rm91KMFqs60

我正在快速建立一个RegisterPage,并将支架分成两个容器。一个用于上半部,另一个用于下半部,以便徽标/标题可以位于上半部,并且...

android flutter dart
1个回答
-1
投票

我不明白您为什么要在列内的容器内创建列。是的,一旦您使用过SingleChildScroll视图,就可以进行滚动。但是我不明白为什么在打开键盘然后将其关闭后却滚动(而不是之前)。

© www.soinside.com 2019 - 2024. All rights reserved.