- ( cgfloat
)autoscalew:(
cgfloat
)w;- (cgfloat)autoscaleh:(cgfloat)h;
// 當前螢幕與設計尺寸
(iphone6)
寬度比例
@property
( nonatomic
, assign
) cgfloat
autosizescalew;
// 當前螢幕與設計尺寸
(iphone6)
高度比例
@property
( nonatomic
, assign
) cgfloat
autosizescaleh;
實現自定義方法
- (void
)initautoscalesize;
在 - (
bool
nsdictionary
*)launchoptions;中呼叫此方法
#pragma mark - scalesize
- ( void
)initautoscalesize
else
if (
kscreenheight
== 568
) else
if (
kscreenheight
== 667
) else
if (
kscreenheight
== 736
) else }
- ( cgfloat
)autoscalew:(
cgfloat
)w- (
cgfloat
)autoscaleh:(
cgfloat
)h4.寫控制項時設定字型大小:
[ uifont
systemfontofsize
: autoscalew
( 14
)]設定frame:
cgrectmake
( cgrectgetmaxx
( self
. productnamelabel
. frame
) +
10 , self
. productnamelabel
. top
+ 3, autoscalew
( 32
), autoscalew
( 17
));
iOS 控制項寬高字型大小適配方法
cgfloat autoscalew cgfloat w cgfloat autoscaleh cgfloat h 當前螢幕與設計尺寸 iphone6 寬度比例 property nonatomic assign cgfloat autosizescalew 當前螢幕與設計尺寸 iphone6 高度...
iOS 控制項寬高字型大小適配方法
cgfloat autoscalew cgfloat w cgfloat autoscaleh cgfloat h 當前螢幕與設計尺寸 iphone6 寬度比例 property nonatomic assign cgfloat autosizescalew 當前螢幕與設計尺寸 iphone6 高度...
IOS適配方法 標註篇
做適合自動布局和自動適配的標註,ui配合 如果設計師了解html和css會容易理解一些,我自己也只是了解html的皮毛,設計師在設計介面的時候標註的資料最好不要寫固定的多少px,使用絕對定位那是ip4之前的方案,尤其現在出來了ip6和plus,如果現在還用絕對定位,設計師和工程師效率會很低,所以我們...