Showing
1 changed file
with
4 additions
and
2 deletions
@@ -12,6 +12,8 @@ | @@ -12,6 +12,8 @@ | ||
12 | **适配须知:** | 12 | **适配须知:** |
13 | 13 | ||
14 | 原版设计图的约束数值都是按照iPhone6(4.7-inch)的设计给的,在项目中都是按照iPhone5(4-inch)的数值实际使用的 | 14 | 原版设计图的约束数值都是按照iPhone6(4.7-inch)的设计给的,在项目中都是按照iPhone5(4-inch)的数值实际使用的 |
15 | + 例如:程序中有这样一行代码:UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)]; | ||
16 | + 适配后的代码是:UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayOutForScaleIPhone6P(100 / 2 * 0.854), LayOutForScaleIPhone6P(100))]; | ||
15 | 17 | ||
16 | **方法1:** | 18 | **方法1:** |
17 | 19 | ||
@@ -19,7 +21,7 @@ | @@ -19,7 +21,7 @@ | ||
19 | 21 | ||
20 | **适用环境:** | 22 | **适用环境:** |
21 | 23 | ||
22 | - 在没有新的设计图的情况下,项目内的参数都需要这个宏来做处理 | 24 | + 在没有新的设计图的情况下,项目内的参数都需要这个宏来,参数是:(按照iPhone6给的约束计算出的iPhone5的标准) |
23 | 25 | ||
24 | 26 | ||
25 | **方法名2:** | 27 | **方法名2:** |
@@ -28,4 +30,4 @@ | @@ -28,4 +30,4 @@ | ||
28 | 30 | ||
29 | **适用环境:** | 31 | **适用环境:** |
30 | 32 | ||
31 | - 在有iPhone6P新设计图的情况下,需要使用这个方法,第一个参数是:(原来按照iPhone6给的约束),第二个参数是:(新的按照iPhone6P给的约束) | 33 | + 在有iPhone6P新设计图的情况下,需要使用这个宏,第一个参数是:(按照iPhone6给的约束计算出的iPhone5的标准),第二个参数是:(新的按照iPhone6P给的约束) |
-
Please register or login to post a comment