You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static int getScreenHeight() {
WindowManager wm = (WindowManager) Utils.getApp().getSystemService(Context.WINDOW_SERVICE);
if (wm == null) return -1;
Point point = new Point();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
wm.getDefaultDisplay().getRealSize(point);
} else {
wm.getDefaultDisplay().getSize(point);
}
return point.y;
}
The text was updated successfully, but these errors were encountered:
感谢楼主分享。
在Redmi k30 pro测试录屏发现视频左右有黑边,最后定位找到
getDisplayMetrics().heightPixel
获取到的屏幕高度不对,缺失了几十像素,改成了下面的方法获取屏幕高度:The text was updated successfully, but these errors were encountered: