iOS 4:掌握AutoLayout

2016-03-27  本文已影响89人  d2cd99b0efce

如何进行接口设计

消息循环

UIView的3种初始化方法

在学习swift的时候,一直以来清楚为什么会有initWithCoder的存在,现在清楚了。
双击屏幕中心可以满屏播放.png

框架

//objc
@property (nonatomic, strong) UIColor *otherColor NS_DEPRECATED_IOS(2_0,3_0);

NSTimer

//objc
//创建了定时器,但是并未启动
[NSTimer timeWithTimeInterval:1.5 target:self selector:@selector(nextPage) userInfo:nil, repeats:YES];

//创建并默认启动了定时器
self。timer = [NSTimer scheduledTimerWithTimeInterval:(NSTimeInterval) target:(id) selector:(SEL) userInfo:(id) repeats:(BOOL)];

//启动定时器
[self.timer fire]
//关闭定时器
[self.timer invalidate]

屏幕适配的发展历史,重要:AutoLayout

小码哥讲解了自动布局发展的历史,在iOS系统初期,使用的是代码的方式;中期使用了autoResizing方式;现在使用AutoLayout。但是AutoLayout是将代码简化到了属性的设置中,使得autoLayout比较方便,但是自定义控件使用autoLayout代码的方式仍旧特别麻烦。之前接触过autoLayout代码的设置方式,觉得自己天资愚笨,就放弃了,原来这个都不受大家待见。

视网膜屏幕 retina高清屏幕

Ember Library Mediator.png

UITextField

tips

//objc
[UIView animateWithDurationn:2.0 animations: ^{
    [self.blueView layoutIfNeeded];
}];
//objc
[self.scrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
上一篇 下一篇

猜你喜欢

热点阅读