utils/src/adapt_util library

Classes

AdaptUtil

Properties

isIPhoneX bool
no setter
screenBottomBarHeightDp double
底部安全区距离 dp
no setter
screenDevicePixelRatio double
The number of device pixels for each logical pixe
getter/setter pair
screenHeightDp double
当前设备高度 dp
no setter
screenStatusBarHeightDp double
状态栏高度 dp 刘海屏会更高
no setter
screenToolbarHeightDp double
导航栏高度 dp
getter/setter pair
screenWidthDp double
当前设备宽度 dp
no setter

Functions

adaptDp(dynamic number) → dynamic
根据设计稿的比例适配dp保证不变形
adaptOnePx() → dynamic
根据设备适配1px像素大小
adaptPx(dynamic number) → dynamic
根据设计稿的比例适配像素保证不变形