In this tutorial, I will show you how to customized page. Today I will show you how to change the background of your view with an image. Put this code in .m file where you want to change the background.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
//change the background image
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"common_bg"]];
}
So thats it hope you enjoy this tutorial. Note that the size of the image is 320pixels in width and 480pixels in height and 2times 640pixels width and 960pixels height.
No comments:
Post a Comment