Android--获取标题栏,状态栏,屏幕高度
2024-08-20 13:45:54
获取状态栏高度
Rect frame = new Rect();
getWindow().getDecorView().getWindowVisibleDisplayFrame(frame);
int statusBarHeight = frame.top;
获取actionBar的高宽度
有一个属性:
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
获取屏幕高度,宽度
DisplayMetrics dm = new DisplayMetrics(); this.getWindowManager().getDefaultDisplay().getMetrics(dm);//this指当前activity screenWidth =dm.widthPixels; screenHeight =dm.heightPixels;
最新文章
- C# base 64图片编码解码
- node-sass安装不成功的解决方案
- Oracle round函数是什么意思?怎么运用?
- The Run-Time Constant Pool The Constant Pool
- 由于无法创建应用程序域,因此未能执行请求。错误: 0x80070002 系统找不到指定的文件
- NetworkComms.Net github下载地址
- WEB安全--Google Hacking
- 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports
- RTMP协议详解(转)
- leetcode@ [139/140] Word Break &; Word Break II
- Graphql graffiti
- 解决Crystal Report XI R2不能在64操作系统正常工作的问题-web程序
- World Cup
- java基础解析系列(十)---ArrayList和LinkedList源码及使用分析
- Google Translation Via Python
- 纵观 jBPM:从 jBPM3 到 jBPM5 以及 Activiti5
- Leetcode:204
- android小程序-电子钢琴-滑动连续响应
- Excel 如何快速切换到最后一行
- django分页的东西, 不详细, 但是也足够了。