UIColor *color1=[UIColor colorWithRed:155/255 green:255/255 blue:255/255 alpha:1];//方法1,使用 静态方法创建color _view1.backgroundColor=color1; UIColor *color2=[[UIColor alloc] initWithRed:222/255 green:213/255 blue:221/255 alpha:1];//方法2,使用 实例方法 创建color [_view2 setBackgroundColor:color2];
self.navigationController.navigationBar.backgroundColor = [UIColor colorWithRed:253/255.0 green:50/255.0 blue:58/255.0 alpha:1.0];
!!!!要加.0切记
//[UIColor colorWithRed:143/255.0 green:186/255.0 blue:55/255.0 alpha:1.0];//呼伦贝尔草原绿
//将图层的边框设置为圆脚 myWebView.layer.cornerRadius = 8; myWebView.layer.masksToBounds = YES; //给图层添加一个有色边框 myWebView.layer.borderWidth = 5; myWebView.layer.borderColor = [[UIColor colorWithRed:0.52 green:0.09 blue:0.07 alpha:1] CGColor];