Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
LiZhuoyuan
2018-12-17 11:58:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2018-12-17 11:58:35 +0800
Commit
87069d77afbf38f65e11483ebfc588ef553013dd
87069d77
1 parent
cb989338
Update README_CN.md
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
README_CN.md
README_CN.md
View file @
87069d7
...
...
@@ -34,6 +34,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
### 初始化设置尺寸
在使用之前请设置好设计稿的宽度和高度,传入设计稿的宽度和高度(单位px)
一定在MaterialApp的home中的页面设置(即入口文件,只需设置一次),以保证在每次使用之前设置好了适配尺寸:
```
...
...
@@ -43,10 +44,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
### 使用:
适配尺寸:
#### 适配尺寸:
传入设计稿的px尺寸:
//传入设计稿的px尺寸:
根据款第适配 width: ScreenUtil().setWidth(540),
根据高度适配 height: ScreenUtil().setHeight(200),
**注意**
...
...
@@ -71,7 +74,7 @@ Container(
),
```
适配字体:
####
适配字体:
```
ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放
...
...
@@ -87,7 +90,7 @@ for example:
```
其他相关api:
####
其他相关api:
```
ScreenUtil.pixelRatio //设备的像素密度
ScreenUtil.screenWidth //设备宽度
...
...
Please
register
or
login
to post a comment