当前位置:网站首页>Flutter 获取状态栏statusbar的高度
Flutter 获取状态栏statusbar的高度
2022-07-31 16:14:00 【可口码农】
之所以发这篇短文是因为我使用网络上大量推荐的解决方案无法 获取到 statusbar的高度。
final double statusBarHeight = MediaQuery.of(context).padding.top;这代码无法获取得到真实的statusbar 高度。
如果你使用以上方法也获取不到真是的statusbar高度,推荐使用
//先引入
import 'dart:ui';
MediaQueryData.fromWindow(window).padding.top;
边栏推荐
- How C programs run 01 - the composition of ordinary executable files
- [TypeScript] In-depth study of TypeScript type operations
- Unity中实现点选RenderTexture中的3D模型
- Stuck in sill idealTree buildDeps during npm installation, npm installation is slow, npm installation is stuck in one place
- 使用 Postman 工具高效管理和测试 SAP ABAP OData 服务的试读版
- The use of button controls
- update data table update
- 牛客 HJ18 识别有效的IP地址和掩码并进行分类统计
- type of timer
- C language - function
猜你喜欢

Browser's built-in color picker

C语言”三子棋“升级版(模式选择+AI下棋)

基于C语言的编译器设计与实现

01 Encounter typescript, build environment

【C语言】LeetCode27.移除元素

【TypeScript】深入学习TypeScript类型操作

"Autumn Recruitment Series" MySQL Interview Core 25 Questions (with answers)

Tencent Cloud Deployment----DevOps

Internet banking stolen?This article tells you how to use online banking safely

SringMVC中个常见的几个问题
随机推荐
使用 GraphiQL 可视化 GraphQL 架构
form 表单提交后,使页面不跳转[通俗易懂]
After the form is submitted, the page does not jump [easy to understand]
Premiere Pro 2022 for (pr 2022)v22.5.0
WPF project - basic usage of controls entry, you must know XAML
二分查找的细节坑
单细胞测序流程(单细胞rna测序)
LeetCode_733_图像渲染
数据表插入数据insert into
Why is the field of hacking almost filled with boys?
【7.28】代码源 - 【Fence Painting】【合适数对(数据加强版)】
牛客 HJ20 密码验证合格程序
EF Core 2.2中将ORM框架生成的SQL语句输出到控制台
org.apache.jasperException(could not initialize class org)
牛客 HJ16 购物单
i.MX6ULL driver development | 33 - NXP original network device driver reading (LAN8720 PHY)
SringMVC中个常见的几个问题
Implement anti-shake and throttling functions
多主复制的适用场景(1)-多IDC
Insert into data table to insert data