1

since a couple of days I'm trying to set the background of a MonoTouch.Dialog to blue ... I collect a lot of information while searching like this one How to set the background to transparent on a DialogViewController and this UITableView backgroundColor always gray on iPad but I can't make it work for my usage ...

What I like to do is to create a DialogViewController for my root element with a blue background and this is what I'm doing:

        _rootVC = new DialogViewController (_rootElement);
        _rootVC.View.BackgroundColor = UIColor.Blue;
        _rootVC.View.Opaque=false;
        _rootVC.TableView.BackgroundColor=UIColor.Blue;
        _rootVC.TableView.Opaque=false;
        _nav = new UINavigationController (_rootVC);
        _window.RootViewController = _nav;

The root element is fine the whole code works - only no more idea why I can't change the background color ... Can you help please?

Thanks

Andre

Community
  • 1
  • 1
Andre Bergmann
  • 59
  • 3
  • 10

1 Answers1

1

Try this:

_rootVC.TableView.BackgroundView = null;

By default UITableView with grouping uses blue background with white lines. It uses BackgroundView property.

Maxim Korobov
  • 2,574
  • 1
  • 26
  • 44