Home > DeveloperSection > Forums > setting background image on iPhone app
Karen Green
Karen Green

Total Post:6

Points:42
Posted on    November-02-2015 1:29 AM

 iPhone iPhone  Ios  Objective C 
Ratings:


 1 Reply(s)
 351  View(s)
Rate this:
I have created an iPhone app, now I want to set a single Image as a background on my app,
no matter what view Controller are on.
How can I solve this problem, please help me?


Tarun Kumar

Total Post:210

Points:1614
Supported
Posted on    November-02-2015 1:46 AM

Here is an easy solution of your problem.
Use code like this:

self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage

imageNamed:@"image_name_with_extention"]];

You can use this code with the delegate like this:

window.backgroundColor = [UIColor colorWithPatternImage:[UIImage

imageNamed:@"image_name_with_extention"]];

and if you want to set image for each view, do this:

self.view.backgroundColor = [UIColor clearColor];

Don't want to miss updates? Please click the below button!

Follow MindStick