首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SingleChildScrollView - Flutter的问题

SingleChildScrollView - Flutter的问题
EN

Stack Overflow用户
提问于 2020-06-09 11:59:04
回答 1查看 44关注 0票数 0

我试图让一个容器固定下来,屏幕的另一部分可以做一些滚动操作,有没有可能不复制屏幕,只复制这两个事件?

代码语言:javascript
复制
return SingleChildScrollView(
  physics: NeverScrollableScrollPhysics(),
      child: Container(
    child: Column(
      children: <Widget>[
        Container(
          height: 200,
          width: double.infinity,
          color: Colors.red,
        ),
        SingleChildScrollView(


          child: Container(color: Colors.blue,height: 1000,width: double.infinity,))
       /*  body(context, screenWidth, screenHeight),
        bottmtop(context), */
      ],
    ),
  ),
);
EN

回答 1

Stack Overflow用户

发布于 2020-06-09 12:25:59

您可以使用此示例作为它。如果您想要用户列表,请使用SliverList代替SliverFillRemaining;

代码语言:javascript
复制
 class HeadState extends State<Head> {
      @override
      Widget build(BuildContext context) {
        var screenHeight = MediaQuery.of(context).size.height;
        var screenWidth = MediaQuery.of(context).size.width;

        return Scaffold(
          bottomNavigationBar: BottomNavigationBar(items: []),
          body: CustomScrollView(
            slivers: <Widget>[
              SliverAppBar(
                expandedHeight: screenHeight / 4,
                flexibleSpace: Container(
                  color: Colors.red,
                ),
              ),
              SliverFillRemaining(
                child: Container(
                  height: screenHeight - screenHeight / 4,
                  color: Colors.blue,
                ),
              )
            ],
          ),
        );
      }
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62274786

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档