suyuexin

Updated iPhone适配 (markdown)

... ... @@ -12,8 +12,6 @@
**适配须知:**
原版设计图的约束数值都是按照iPhone6(4.7-inch)的设计给的,在项目中都是按照iPhone5(4-inch)的数值实际使用的
例如:程序中有这样一行代码:UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)];
适配后的代码是:UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayOutForScaleIPhone6P(100 / 2 * 0.854), LayOutForScaleIPhone6P(100))];
**方法1:**
... ... @@ -22,7 +20,13 @@
**适用环境:**
在没有新的设计图的情况下,项目内的参数都需要这个宏来,参数是:(按照iPhone6给的约束计算出的iPhone5的标准)
**例如:**
例如:程序中有这样一行代码:
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)];
适配后的代码是:
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayOutForScaleIPhone6P(100 / 2 * 0.854), LayOutForScaleIPhone6P(100))];
**方法名2:**
... ... @@ -30,4 +34,12 @@
**适用环境:**
在有iPhone6P新设计图的情况下,需要使用这个宏,第一个参数是:(按照iPhone6给的约束计算出的iPhone5的标准),第二个参数是:(新的按照iPhone6P给的约束)
\ No newline at end of file
在有iPhone6P新设计图的情况下,需要使用这个宏,第一个参数是:(按照iPhone6给的约束计算出的iPhone5的标准),第二个参数是:(新的按照iPhone6P给的约束)
**例如:**
例如:程序中有这样一行代码:
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100 / 2 * 0.854, 100)];
新设计图的约束是width = 50 ; height = 120;
适配后的代码是:
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, LayoutForFitIPhone6P(100 / 2 * 0.854, 50), LayoutForFitIPhone6P(100, 120))];
\ No newline at end of file
... ...