I am trying to set the background for several UITableViews that load inside the UINavigationController. I am using the appearance proxy added in iOS 5, but it does not work as I expect.
The application uses the UISplitViewController, with the main view being the UINavigationController. Inside this there is a subclass of UITableViewController called PBMasterTableViewController. In my AppDelegate, I have the following:
UIImageView *bgView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menuBg.png"]] autorelease];
[[UITableView appearanceWhenContainedIn:[PBMasterTableViewController_Ipad class], nil] setBackgroundView:bgView];
This works fine, and my main menu in split mode has the background that I want.
In this main menu, I have 3 other UITableViewControllers that are extruded to the nav controller when I select the appropriate rows. However, I cannot change the background of these tables using the appearance proxy. I am trying to do the following:
UIImageView *bgView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"menuBg.png"]] autorelease];
[[UITableView appearanceWhenContainedIn:[PBTwitterTableViewController class], nil] setBackgroundView:bgView];
It is also in appDelegate right below the previously shown code that works (without repeating the creation of the image), but it just does nothing! When I click an instance of PBTwitterTableViewController on the nav controller, I just get a standard table view without changing the background.
I know that I could just change the background views in the tableViewControllers themselves, however I do not want these backgrounds to be there when the menu is shown in the popViewControllers popover when rotated to portait, so I am trying to use the appearance of WhenContainedIn
, UISplitViewController, UITableView , , .
- , , popover, -, - ?
:
UINavigationController [[UITableView appearanceWhenContainedIn:[PBMenuNavigationController class], nil] setBackgroundView:bgView];, , - UITableView, , :(