SliverAppBar中的最小高度(颤振)? [英] Minimum height in SliverAppBar (Flutter)?

查看:789
本文介绍了SliverAppBar中的最小高度(颤振)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在折叠时在SliverAppBar上设置最小高度?如果可以,我该怎么做?

Is it possible set a minimum height on SliverAppBar when is collapsed? If yes, how I can do that?

Work在SliveAppBar上添加了一个底部小部件:

Work's adding a bottom widget on SliveAppBar:

底部:PreferredSize( preferredSize:Size(20.0,20.0), 子级:Text(''), ),

bottom: PreferredSize( preferredSize: Size(20.0, 20.0), child: Text(''), ),

推荐答案

答案是肯定的.如果要使其大于当前尺寸,可以设置一个底部"窗口小部件,该窗口小部件在应用程序栏的主要部分下方占据一些空间,因此可以使其显得更大.

The answer to this is both yes and no. If you want to make it larger than what it currently is, you can set a 'bottom' widget which takes up some space below the main part of the app bar, so you can make it appear larger.

尽管更改应用程序栏的实际栏"部分的高度是不可能的,因为它使用常数kToolbarHeight来确定其高度,因此无法轻松减小工具栏的大小.

It isn't possible to change the height of the actual 'bar' part of the appbar though as it uses the constant kToolbarHeight to determine its height, and so there's no way to easily decrease the size of the toolbar.

话虽这么说,flutter是开源的,所以您只需复制SliverAppBar& RenderSliv​​erAppBar并以这种方式更改高度,尽管这可能不是一个好主意.

That being said, flutter is open-source so you could just copy SliverAppBar & RenderSliverAppBar and change the height that way as well, although that's probably not a great idea.

这篇关于SliverAppBar中的最小高度(颤振)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆