Use UIView to make the effect of the neon light, and use uiview to make the neon light
Effect
The Code is as follows (only the implementation part is available)
@ Interface AppDelegate () @ end @ implementation AppDelegate-(void) dealloc {[_ window release]; [super dealloc];}-(BOOL) application :( UIApplication *) application didfinishlaunchingwitexceptions :( NSDictionary *) launchOptions {self. window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]; // Override point for customization after application launch. self. window. backgroundColor = [UIColor whiteColor]; [self. window makeKeyAndVisible]; [_ window release]; // define view, color module UIView * view1 = [[UIView alloc] initWithFrame: CGRectMake (20, 20,340,340)]; view1.backgroundColor = [UIColor greenColor]; [self. window addSubview: view1]; [view1 release]; view1.tag = 1; UIView * view2 = [[UIView alloc] initWithFrame: CGRectMake (40, 40,300,300)]; view2.backgroundColor = [UIColor purpleColor]; [self. window addSubview: view2]; [view2 release]; view2.tag = 2; UIView * view3 = [[UIView alloc] initWithFrame: CGRectMake (60, 60,260,260)]; view3.backgroundColor = [UIColor magentaColor]; [self. window addSubview: view3]; [view3 release]; view3.tag = 3; UIView * view4 = [[UIView alloc] initWithFrame: CGRectMake (80, 80,220,220)]; view4.backgroundColor = [UIColor redColor]; [self. window addSubview: view4]; [view4 release]; view4.tag = 4; UIView * view5 = [[UIView alloc] initWithFrame: CGRectMake (100,100,180,180)]; view5.backgroundColor = [UIColor orangeColor]; [self. window addSubview: view5]; [view5 release]; view5.tag = 5; UIView * view6 = [[UIView alloc] initWithFrame: CGRectMake (120,120,140,140)]; view6.backgroundColor = [UIColor yellowColor]; [self. window addSubview: view6]; [view6 release]; view6.tag = 6; UIView * view7 = [[UIView alloc] initWithFrame: CGRectMake (140,140,100,100)]; view7.backgroundColor = [UIColor cyanColor]; [self. window addSubview: view7]; [view7 release]; view7.tag = 7; // define a timer to implement color block change NSTimer * timer = [nst1_scheduledtimerwithtimeinterval: 0.3 target: self selector: @ selector (changeColor) userInfo: nil repeats: YES]; return YES;}-(void) changeColor {// define a color to receive 7 color UIColor * color = [self. window viewWithTag: 7]. backgroundColor; // for (int I = 6; I> 0; I --) {[self. window viewWithTag: I + 1]. backgroundColor = [self. window viewWithTag: I]. backgroundColor;} // the innermost part is the outermost [self. window viewWithTag: 1]. backgroundColor = color;} @ end
Copyright Disclaimer: This article is an original article by the blogger. For more information, see the original article address.