首页 > 代码库 > 背景颜色的随机显示

背景颜色的随机显示

 

直接上代码:

- (void)viewDidLoad{    [super viewDidLoad];    // Do any additional setup after loading the view.        self.title=@"背景颜色的随机显示";        CGFloat red = (CGFloat)arc4random() / 0x100000000;    CGFloat green = (CGFloat)arc4random() / 0x100000000;    CGFloat blue = (CGFloat)arc4random() / 0x100000000;    self.view.backgroundColor = [UIColor colorWithRed:red green:green blue:blue alpha:1.0f];}

 

背景颜色的随机显示