How do I set the background color of an UITableView within an UIPopoverController?

Grouped table views have a custom view in the backgroundView property. This custom view is what displays the background. If you want to change the background, you should create your own view and assign it there.

In your case, you probably want something like the following.

Up vote 3 down vote favorite 1 share g+ share fb share tw.

I am using iOS SDK 4.2. I have an UIPopoverController initialized with a navigation controller which is initialized with a view controller. One of the subviews of the view controller is a grouped table view. I would like to change the background color of the table view.

However, if I do in the viewDidLoad method of the view controller self.myTableView. BackgroundColor = UIColor blackColor; the background does not changes, when the popover appears, the background of the table view is gray. Any clue?

What's wrong with this approach? Thank you in advance. Ios ipad uipopovercontroller ipad-ui link|improve this question edited Jan 21 at 22:19Marco657413 asked Jan 14 '11 at 23:02unforgiven11.6k52845 75% accept rate.

Grouped table views have a custom view in the backgroundView property. This custom view is what displays the background. If you want to change the background, you should create your own view and assign it there.

In your case, you probably want something like the following: UIView *bgView = UIView alloc init autorelease; bgView. BackgroundColor = UIColor blackColor; bgView. Opaque = YES; self.myTableView.

BackgroundView = bgView.

3 Kevin, your suggestion works perfectly. I have also been told and verified that, simply clearing the table view's background view before setting the table view's background color, provides the same result: self.myTableView. BackgroundView = nil; self.myTableView.

BackgroundColor = UIColor blackColor; – unforgiven Jan 15 '11 at 7:15.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions