你好,歡迎來到IOS教程網

 Ios教程網 >> IOS訊息 >> 關於IOS >> 用iOS的UI知識編出霓虹燈效果(經典小題)

用iOS的UI知識編出霓虹燈效果(經典小題)

編輯:關於IOS

for (int i =0 ; i < 7; i++) {

UIView *view = [[UIViewalloc] initWithFrame:CGRectMake(0 + i *20, 0 + i *20,320 - 40 * i ,568 - i * 40)];

CGFloat color = (arc4random() %256 /255.0 );

CGFloat saturation = ( arc4random() % 128 / 256.0 ) + 0.5;

CGFloat brightness = ( arc4random() % 128 / 256.0 ) + 0.5;

view.backgroundColor = [UIColorcolorWithHue:color saturation:saturation brightness:brightnessalpha:1];

[self.windowaddSubview:view];

[view release];

}

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved