最終更新:2017-06-06 (火) 03:17:47 (2508d)  

UIColor
Top / UIColor

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIColor_Class/Reference/Reference.html

描画色の指定

[[UIColor blackColor] set];//色

Swift

Swift 2

  • view.backgroundColor = UIColor.whiteColor()

Swift 3

  • view.backgroundColor = UIColor.white

view.backgroundColor = .white

背景画像の指定

- (void)viewDidLoad {
    [super viewDidLoad];

    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg-green.jpg"]];
}

Swift