Adding A Background Image In Interface Builder

后端 未结 6 2189
庸人自扰
庸人自扰 2021-02-19 06:34

I\'m trying to add a custom image as a background for my application using Xcode 4.2, but I\'m not too sure how to do it. I can add plain colors as the background in Interface B

6条回答
  •  日久生厌
    2021-02-19 07:27

    If you want to change the background of all screens of the app then you can do it your AppDelegate.m file.First of all make all xib files background color clear color.Then use following code to change background color.

    self.window.backgroundColor = [UIColor redcolor];
    

    If you want to make background color like an Image then use following code.

    self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background_image.1.png"]];
    

提交回复
热议问题