如何为底部划分bar设置约束箱|扑
我试图使用以下方式设置一个bottomNavigationBar
:
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 500),
child: // child (Two buttons, occupying each ~40% of the total width
)
但是当我这样做时,bottom bottomNavigationbar
占据显示的完整宽度(iPad pro 11''),而我仅使用是否希望此底部范围
占用这么多空间(少于500),
有人知道有什么问题吗? 我有这个Boxted Box
的身体,没有问题,
谢谢! :)
I was trying to setup a bottomNavigationBar
with:
ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 500),
child: // child (Two buttons, occupying each ~40% of the total width
)
But when I do this, the bottomNavigationBar
takes the full width of the display (an iPad Pro 11''), and I only want this bottomNavigationBar
to take so much space (less than 500)
Anyone knows what's the problem?
I have this ConstrainedBox
for the body and there's no issue
Thanks! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果显示尺寸大于500,则以下示例将“ bottomnavigationbar”将“ bottomnavigationbar”限制为500,否则将占据屏幕的完整尺寸。
the following example will constrain the ´bottomNavigationBar´ to 500 if the display size is bigger than 500, otherwise it will take the full size of the screen.