We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
` /// 实际的dp与UI设计px的比例 /// The ratio of the actual dp to the design draft px double get scaleWidth => _screenWidth / uiWidthPx;
double get scaleHeight => _screenHeight / uiHeightPx;
double get scaleText => scaleWidth > scaleHeight ? scaleWidth : scaleHeight; `
97行这段感觉有点奇怪,假设设计图是iPhone 6(375667),UI尺寸是 7501334 iPhone 6(375667)上 scaleWidth和scaleHeight都是0.5 iPhone X(375812)上 scaleWidth是0.5 scaleHeight是812/1334=0.6
iPhone X上最终字体是按高度计算缩放的
当然也可以把调整传入高度
ScreenUtil.init( context, width: 750, height: 2000, // 放大高度让 scaleHeight始终偏小 allowFontScaling: false, );
version 1.0.1
The text was updated successfully, but these errors were encountered:
我一开始想的是支持pad上的字体缩放, 看起来有点草率了 我再考虑一下怎么弄更好
Sorry, something went wrong.
dad7877
No branches or pull requests
`
/// 实际的dp与UI设计px的比例
/// The ratio of the actual dp to the design draft px
double get scaleWidth => _screenWidth / uiWidthPx;
double get scaleHeight => _screenHeight / uiHeightPx;
double get scaleText => scaleWidth > scaleHeight ? scaleWidth : scaleHeight;
`
97行这段感觉有点奇怪,假设设计图是iPhone 6(375667),UI尺寸是 7501334
iPhone 6(375667)上 scaleWidth和scaleHeight都是0.5
iPhone X(375812)上 scaleWidth是0.5 scaleHeight是812/1334=0.6
iPhone X上最终字体是按高度计算缩放的
当然也可以把调整传入高度
ScreenUtil.init( context, width: 750, height: 2000, // 放大高度让 scaleHeight始终偏小 allowFontScaling: false, );
version 1.0.1
The text was updated successfully, but these errors were encountered: