I’m trying to change the color of a UITableViewController when using a split view. Then the style is set to grouped, the background seems to light gray no matter what.
I create a new iPad Split Application solution and add the following code to RootViewController:
public RootViewController () : base( UITableViewStyle.Grouped) // base ("RootViewController", null)
{
this.TableView.BackgroundColor = UIColor.Red;
this.View.BackgroundColor = UIColor.Red;
this.View.Layer.BorderColor = UIColor.Green.CGColor;
this.TableView.BackgroundView.BackgroundColor = UIColor.Brown;
I’m pulling my hair out trying to work out why its always light gray.
You do not change the color of the controller but of one (or many) of its views.
Also it’s generally
TintColorthat must be used (notBackgroundColor). A bit confusing (I think it’s related to the use of gradients, over the background, used in many place – but I could be wrong).