Ian Vink
Ian Vink

Reputation: 68830

MonoTouch.Dialog: Change Color of Section

Normally to change the characteristics (Font, color) of a Section in Plain mode we have to create an entire view from scratch.

In cases where a simple change is needed in color/size, is there an easier way to do this?

Here's what I tend to do:

    var header = new UILabel(new RectangleF(0, 0, 320, 25)){
      Font = UIFont.BoldSystemFontOfSize (22),
      TextColor = UIColor.White,
      BackgroundColor = SomethingPretty,
      Text = "Something"
};

Section secGroup = new Section(header);

enter image description here

Upvotes: 0

Views: 809

Answers (1)

Ian Vink
Ian Vink

Reputation: 68830

This appears to be the simplest way:

var header = new UILabel(new RectangleF(0, 0, 320, 25)){
  Font = UIFont.BoldSystemFontOfSize (22),
  TextColor = UIColor.White,
  BackgroundColor = SomethingPretty,
  Text = "Something"
};

Section secGroup = new Section(header);

Upvotes: 2

Related Questions