AndroidAutoSize icon indicating copy to clipboard operation
AndroidAutoSize copied to clipboard

横竖屏切换时,偶现screenWidth 取值不对,在竖屏转横屏后取的为屏幕的高度。导致后续页面显示异常

Open just0119 opened this issue 3 years ago • 1 comments

application.registerComponentCallbacks(new ComponentCallbacks() { @Override public void onConfigurationChanged(Configuration newConfig) { if (newConfig != null) { if (newConfig.fontScale > 0) { mInitScaledDensity = Resources.getSystem().getDisplayMetrics().scaledDensity; AutoSizeLog.d("initScaledDensity = " + mInitScaledDensity + " on ConfigurationChanged"); } isVertical = newConfig.orientation == Configuration.ORIENTATION_PORTRAIT; int[] screenSize = ScreenUtils.getScreenSize(application); mScreenWidth = screenSize[0]; mScreenHeight = screenSize[1]; } }

just0119 avatar Jun 28 '22 08:06 just0119

請問有解嗎

FongMi avatar Feb 16 '23 16:02 FongMi