iOS 霓虹灯效果(同种颜色依次向外扩展)
2014-08-21 22:52
495 查看
#import "ZXHAppDelegate.h" <span style="font-size:18px;">@implementation ZXHAppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. /* NSArray *arr = [NSArray arrayWithObjects:[UIColor redColor],[UIColor orangeColor], [UIColor yellowColor], [UIColor greenColor],[UIColor cyanColor],[UIColor blueColor], [UIColor purpleColor], nil]; for (NSInteger i = 0; i < 7; i ++) { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0 + i * 20, 0 + i *20, 320 - 40 * i , 568 - i * 40)]; view.backgroundColor = arr[random()%6]; [self.window addSubview:view]; [view release]; } */ //红色视图 UIView *redView=[[UIView alloc] initWithFrame:CGRectMake(0, 153, 320, 320)]; redView.backgroundColor=[UIColor redColor]; redView.tag = 101; [self.window addSubview:redView]; [redView release]; //橙色视图 UIView *oriangeView=[[UIView alloc] initWithFrame:CGRectMake(20, 20, 280, 280)]; oriangeView.backgroundColor=[UIColor orangeColor]; oriangeView.tag = 102; [redView addSubview:oriangeView]; [oriangeView release]; //黄色视图 UIView *yellowView=[[UIView alloc] initWithFrame:CGRectMake(20, 20, 240, 240)]; yellowView.backgroundColor=[UIColor yellowColor]; yellowView.tag = 103; [oriangeView addSubview:yellowView]; [yellowView release]; //绿色视图 UIView *greenView=[[UIView alloc] initWithFrame:CGRectMake(20,20, 200, 200)]; greenView.backgroundColor=[UIColor greenColor]; greenView.tag = 104; [yellowView addSubview:greenView]; [greenView release]; //青色视图 UIView *cyanView=[[UIView alloc] initWithFrame:CGRectMake(20, 20, 160, 160)]; cyanView.backgroundColor=[UIColor cyanColor]; cyanView.tag = 105; [greenView addSubview:cyanView]; [cyanView release]; //蓝色视图 UIView *blueView=[[UIView alloc] initWithFrame:CGRectMake(20, 20, 120, 120)]; blueView.backgroundColor=[UIColor blueColor]; blueView.tag = 106; [cyanView addSubview:blueView]; [blueView release]; //紫色视图 UIView *purpleView=[[UIView alloc] initWithFrame:CGRectMake(20, 20, 80, 80)]; purpleView.backgroundColor=[UIColor purpleColor]; purpleView.tag = 107; [blueView addSubview:purpleView]; [purpleView release]; [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(Ltime) userInfo:nil repeats:YES]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } - (void)Ltime { UIColor *temp = [self.window viewWithTag:101].backgroundColor; for (int i = 0; i < 6; i++) { [self.window viewWithTag:101 + i].backgroundColor = [self.window viewWithTag:102 + i].backgroundColor; } [self.window viewWithTag:107].backgroundColor = temp; }</span>
相关文章推荐
- ios开发学习-页面控制样式翻页、文字、颜色等效果源码分享
- 【IOS类扩展之Hex值颜色转换】UIColor+Hex
- iOS开发技巧(系列十八:扩展UIColor,支持十六进制颜色设置)
- iOS开发技巧(系列十八:扩展UIColor,支持十六进制颜色设置)
- IOS 霓虹灯效果
- 渐变色,颜色由中心点向外扩散。效果不怎么好。
- iOS中导航栏的渐变颜色效果的实现
- iOS 霓虹灯效果
- iOS开发技巧(系列十八:扩展UIColor,支持十六进制颜色设置)
- iOS开发技巧之扩展UIColor,支持十六进制颜色设置
- ios 颜色渐变效果
- 【iOS】UIColor+Change颜色类的类目扩展
- ios霓虹灯效果(没基础也可以做出好看的霓虹灯)
- iOS 改变状态栏颜色类扩展
- 源码推荐(3.12):可扩展iOS 弹出视图,Paper卡片式切换效果
- IOS 改变键盘颜色的实现---只有Number Pad和Phone Pad这两种数字键盘才有效果
- IOS 作业项目(3) 霓虹灯效果
- IOS 霓虹灯效果(oc)
- iOS开发 颜色渐变效果
- iOS颜色渐变效果