标签:blog http color io for ar 2014 cti log
//延展添加对象
@interface AppDelegate ()
{
UIView *_containerView;
NSTimer *_timer;
}
@end
//- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中函数体//
//设置计时器
- (void)changeFromInToOut
{
_timer = [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(changeInToOut) userInfo:nil repeats:YES];
}
- (void)changeFromOutToIn
{
_timer = [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(changeOutToIn) userInfo:nil repeats:YES];
}
// 暂停计时器
- (void)stop
{
[_timer invalidate];
}
// 由内而外循环交换颜色
- (void)changeInToOut
{
UIView *temp = [[UIView alloc] init];
int i = 200;
temp.backgroundColor = [_containerView viewWithTag:200].backgroundColor;
for (i = 200; i < 207; i++) {
[_containerView viewWithTag:i].backgroundColor = [_containerView viewWithTag: i + 1].backgroundColor;
}
[_containerView viewWithTag:206].backgroundColor =temp.backgroundColor;
[temp release];
}
// 由外而内循环交换颜色
- (void)changeOutToIn
{
UIView *temp = [[UIView alloc] init];
int i = 206;
temp.backgroundColor = [_containerView viewWithTag:206].backgroundColor;
for (i = 206; i >= 0; i--) {
[_containerView viewWithTag:i].backgroundColor = [_containerView viewWithTag: i - 1].backgroundColor;
}
[_containerView viewWithTag:200].backgroundColor =temp.backgroundColor;
[temp release];
}
标签:blog http color io for ar 2014 cti log
原文地址:http://blog.csdn.net/hakusan/article/details/38755399