Adding A Background Image In Interface Builder

后端 未结 6 2207
庸人自扰
庸人自扰 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:29

    [self.view setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"foo.bar"]]];
    

    You can use this statement. But you should notice that the size of the image should be the size of the view else it will be repeated. For the repeated image it works great.

提交回复
热议问题