File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 2
2
3
3
一个简单的,方便的多屏适配的Android库
4
4
5
- # 本质就是百分比缩放
5
+ ## 本质就是百分比缩放
6
6
7
- ## 和 android-percent-support-lib 的不同
7
+ ### 和 android-percent-support-lib 的不同
8
8
9
9
1 . ** 更科学**
10
10
`` android-percent-support-lib `` 是父控件和子控件的百分比关系
18
18
`` android-percent-support-lib `` 需要把设计尺寸算成百分比
19
19
`` Android-ScaleLayout `` 直接把设计尺寸填入`` layou.xml `` 即可
20
20
21
- ## Android有良好的多屏适配系统,为何设计ScaleLayout?
21
+ ### Android有良好的多屏适配系统,为何设计ScaleLayout?
22
22
23
23
24
24
25
- # 如何使用
25
+ ## 如何使用
26
26
27
- ## 基本原理
27
+ ### 基本原理
28
28
+ 设计属性
29
29
设计手机的宽高,像素密度,设计尺寸(dp)
30
30
+ 设备属性
@@ -41,7 +41,7 @@ float designPixel = designDP * designDensity // dp 转 pixel
41
41
float realPixel = (mScreenWidth * designDensity * getPixelSize()) / (designScreenWidth * mDensity)
42
42
```
43
43
44
- ## 属性
44
+ ### 属性
45
45
46
46
``` xml
47
47
<?xml version =" 1.0" encoding =" utf-8" ?>
@@ -77,7 +77,7 @@ float realPixel = (mScreenWidth * designDensity * getPixelSize()) / (designScree
77
77
</resources >
78
78
```
79
79
80
- ## 使用
80
+ ### 使用
81
81
82
82
``` xml
83
83
<cn .gavinliu.android.lib.scale.ScaleRelativeLayout xmlns : android =" http://schemas.android.com/apk/res/android"
@@ -126,15 +126,15 @@ float realPixel = (mScreenWidth * designDensity * getPixelSize()) / (designScree
126
126
</cn .gavinliu.android.lib.scale.ScaleRelativeLayout>
127
127
```
128
128
129
- ## 注意事项
129
+ ### 注意事项
130
130
131
- 1 . 缩放方式
131
+ 1 . 建议缩放方式
132
132
上下滑动的界面按** 屏幕宽** 等比缩放
133
133
左右滑动的界面按** 屏幕高** 等比缩放
134
- 2 .
135
- `` cn.gavinliu.android.lib.scale.ScaleLayout `` 必须包含 layout_design_ *
134
+ 2 . 控件须知
135
+ `` cn.gavinliu.android.lib.scale.Scale*Layout `` 必须包含 layout_design_ *
136
136
`` layout_scale_by `` 默认值为 width
137
137
138
- # License
138
+ ## License
139
139
140
140
MIT
You can’t perform that action at this time.
0 commit comments