如何以编程方式在抖动中获取Android导航栏的高度和宽度?

问题描述 投票:0回答:2

如何获得此UI元素的高度和宽度(以像素为单位?

How do I get the height and width of this UI element in pixel?

flutter flutter-layout
2个回答
1
投票

使用此获取底部导航栏的高度

MediaQuery.of(context).viewInsets.bottom

0
投票

这对我有用

最终double navigationBarHeight = MediaQuery.of(context).padding.bottom

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