android - 遮盖住所有导航栏的最佳方法是什么

标签 android ios flutter mobile-application flutter-cupertino

我使用Flutter创建了这个UI,但我认为这不是最好的方法,
我想问一下蓝色容器的动画,并在滚动时像导航栏一样显示两个图标作为前导和尾随

enter image description here

这是我的代码:

width = MediaQuery.of(context).size.width;
    height = MediaQuery.of(context).size.height;
    fSectionHeight = 0.35*height;
    return CupertinoPageScaffold(
      backgroundColor: CupertinoColors.white,
      child: SingleChildScrollView(
        child: SafeArea(
          top: false,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              Container(
                  padding: EdgeInsets.only(top: 50,bottom: 20,left: 20,right: 20),
                  margin: EdgeInsets.only(bottom: 20),
                  color: Color(0xFF2FBFFF),
                  height: fSectionHeight,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      GestureDetector(
                        onTap: (){  },
                        child: Icon(CupertinoIcons.back,color: CupertinoColors.white,size: 28),
                      ),
                      GestureDetector(
                          onTap: (){ print("camera cliked"); },
                          child: Container(
                            child: Align(
                              alignment: Alignment.centerRight,
                              child: Icon(CupertinoIcons.photo_camera_solid,color: CupertinoColors.white,size: 44),
                            ),
                            width: width,
                          )
                      ),
                    ],
                  )
              ),
              Column(
                children: <Widget>[
                  Padding(
                    padding: EdgeInsets.only(left: 20,right:20),
                    child: Column(
                      children: <Widget>[
                        Column(
                          children: <Widget>[
                            Align(
                                alignment: Alignment.centerLeft,
                                child: Text("Titre de l'article",style: Styles.formFieldTitle)
                            ),......................
                          ],
                        ),
                      ],
                    ),
                  ),
                ],
              )
            ],
          ),
        )
      )
    );

最佳答案

您可以根据需要使用SliverAppBar为AppBar设置动画。

关于android - 遮盖住所有导航栏的最佳方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59908026/

相关文章:

android - 除非禁用离线持久性,否则 Firestore 对大型集合的查询缓慢

ios - 自动签名无法解决 "projectName"目标的权利文件的问题

ios - 为什么不是我的所有代码都在我的 findObjectsInBackgroundWithBlock :^ being executed?

android - 这里 Maps SDK 控制滚动灵敏度

android - Flutter App 与几乎所有东西都不兼容?

java - radio 组 setOnCheckedChangeListener

android - 从 PackageManager 获取本地化标签名称的方法

android - 传回在单独线程中创建的变量?安卓

ios - 在 Swift 中从 Parse 检索对象数据

flutter - 在 Flutter 中更新嵌套 CupertinoPageScaffold 中的 Scaffold-Properties