android - 在竖屏模式下获取屏幕宽度
问题描述
我想在纵向模式下获得屏幕的宽度。这段代码
public static int getScreenWidth() {
return Resources.getSystem().getDisplayMetrics().widthPixels;
}
给了我完整的宽度,我想要的只是用户可见的宽度(手机屏幕的宽度不是完整的分辨率)。
解决方案
推荐阅读
- reactjs - i18next 未从公用文件夹加载文件
- javascript - 为什么JS说这个函数不是函数
- html - Bootstrap 导航栏问题,让按钮向右拉
- azure-data-explorer - 使用按 Z 排序的 top N 对 X 和 Y 进行汇总
- reactjs - React build 使用 Django 显示白页
- python - tkinter:通过单击移动图像
- css - 如何根据sass中的父属性计算子属性
- javascript - 使用 Javascript (VanillaJS) 添加点击事件并显示/隐藏下一个元素
- c# - 尝试连接到另一台计算机上存储的数据库时出现“等待操作超时”错误
- java - Spring gRPC - 如何使用正文信息拦截异常