px
Start from API_LEVEL
2.0. Please refer to API_LEVEL.
Pixel scaling calculation. The designWidth of each model in the targets object in the app.json is used as the base..
Type
function px(value: PxValue): Result
Parameters
PxValue
| Type | Description |
|---|---|
number | Pixel values based on designWidth |
Result
| Type | Description |
|---|---|
number | Pixel values after scaling calculation |
Example
import { px } from '@zos/utils'
px(480)