SETTING BACKGROUND IMAGE ON IPHONE APP

Karen Green

Total Post:6

Points:42
Posted by  Karen Green
 627  View(s)
Ratings:
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?
  1. Tarun Kumar

    Post:214

    Points:1642
    Re: setting background image on iPhone app

    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];

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!