Adding a background to the entire UISplitViewController

Hey, I want to add a background image to my UISplitViewController, which spans the entire iPad screen and displays under my main and detailed views.

I tried this in several different ways and have not had time yet. If I put it in splitView.view, it just overlays on top of everything in both subtask controllers. If I put it in the main view controller, I can do something normally (put a UITableView on top of it, etc.), but then it covers everything in the detailed view controller. Another route I tried was to place the background image in my own view controller, put the entire section view controller inside this view controller, but no matter what I set the alpha of my split view controller, the background is still stays black.

If someone can point me to get this job, that would be great, thanks!

+5
source share
2 answers

It worked!

First, follow Apple's example of creating a UISplitViewController programmatically here: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/iPadControllers/iPadControllers.html

then add this line before adding VC to the window:

splitVC.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.jpg"]];
+5
source

, , , - , . , , .

, self UISplitViewController, imgView - UIImageView, , end_view_idLoad() (, , )

    self.view.addSubview(imgView)
    self.view.sendSubviewToBack(imgView)
+2

All Articles