How to set background color of UITableView in UIPopoverController?

I am using iOS SDK 4.2. I have a UIPopoverController initialized by a navigation controller that is initialized by a view controller. One of the subzones of the view controller is the presentation of grouped tables. I would like to change the background color in the form of a table. However, if I do in the viewDidLoad method of the view controller

self.myTableView.backgroundColor = [UIColor blackColor];

the background does not change when a popover appears, the background of the table looks gray. Any clue? What is wrong with this approach? Thank you in advance.

+5
source share
1 answer

backgroundView. - , . , . , , - :

UIView *bgView = [[[UIView alloc] init] autorelease];
bgView.backgroundColor = [UIColor blackColor];
bgView.opaque = YES;
self.myTableView.backgroundView = bgView;
+9

All Articles