I have a single image I want as the background for my app no matter what viewcontroller they are on - how do you accomplish this?
Start the Settings app and tap "Wallpaper." Tap "Choose a new wallpaper" and select the screenshot of your photo. You'll be able to include the entire photo from side to side, with black bars at the top and bottom.
Tip: touch and hold the empty space on your home screen and select Wallpaper at the bottom to reach the wallpaper setting screen. Pick the image you want to use as your background. Once your image (portrait or landscape) is selected, you will see a preview of your wallpaper filling up your whole screen.
Here's how you set a background to an image:
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];
Edit: To write up what Felixyz said (and thanks to Manni), do this in your delegate:
window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background.png"]];
And in each view you want to have the image, do this:
self.view.backgroundColor = [UIColor clearColor];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With