Skip to content

Commit

Permalink
Update README_CN.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhuoyuan authored Dec 17, 2018
1 parent cb98933 commit 87069d7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';

### 初始化设置尺寸
在使用之前请设置好设计稿的宽度和高度,传入设计稿的宽度和高度(单位px)

一定在MaterialApp的home中的页面设置(即入口文件,只需设置一次),以保证在每次使用之前设置好了适配尺寸:

```
Expand All @@ -43,10 +44,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';

### 使用:

适配尺寸:
#### 适配尺寸:

传入设计稿的px尺寸:

//传入设计稿的px尺寸:
根据款第适配 width: ScreenUtil().setWidth(540),

根据高度适配 height: ScreenUtil().setHeight(200),

**注意**
Expand All @@ -71,7 +74,7 @@ Container(
),
```

适配字体:
#### 适配字体:
```
ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放
Expand All @@ -87,7 +90,7 @@ for example:
```

其他相关api:
#### 其他相关api:
```
ScreenUtil.pixelRatio //设备的像素密度
ScreenUtil.screenWidth //设备宽度
Expand Down

0 comments on commit 87069d7

Please sign in to comment.