Showing
1 changed file
with
7 additions
and
3 deletions
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | 11 | ||
12 | **适配须知:** | 12 | **适配须知:** |
13 | 13 | ||
14 | - 原版设计图的约束数值都是按照iPhone6(4.7-inch)的设计给的,在项目中都是按照iPhone5(4-inch)的数值实际使用的 | 14 | + 原版设计图的约束数值都是按照iPhone6(4.7-inch)的设计给的,在项目中转换为iPhone5(4-inch)的标准实际使用的 |
15 | 15 | ||
16 | **方法1:** | 16 | **方法1:** |
17 | 17 | ||
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | 19 | ||
20 | **适用环境:** | 20 | **适用环境:** |
21 | 21 | ||
22 | - 在没有新的设计图的情况下,项目内的参数都需要这个宏来,参数是:(按照iPhone6给的约束计算出的iPhone5的标准) | 22 | + 在没有新的iPhone6P的设计图的情况下,项目内的UI约束都需要使用这个宏,参数是:(按照iPhone6给的约束计算出的iPhone5的标准) |
23 | 23 | ||
24 | **例如:** | 24 | **例如:** |
25 | 25 | ||
@@ -42,4 +42,8 @@ | @@ -42,4 +42,8 @@ | ||
42 | UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)]; | 42 | UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)]; |
43 | 新设计图的约束是width = 50 ; height = 120; | 43 | 新设计图的约束是width = 50 ; height = 120; |
44 | 适配后的代码是: | 44 | 适配后的代码是: |
45 | - UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayoutForFitIPhone6P(100 / 2 * 0.854, 50), LayoutForFitIPhone6P(100, 120))]; | 45 | + UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayoutForFitIPhone6P(100 / 2 * 0.854, 50), LayoutForFitIPhone6P(100, 120))]; |
46 | + | ||
47 | +**有疑问?:** | ||
48 | + | ||
49 | + 苏越鑫suyuexin@boxfish.cn |
-
Please register or login to post a comment