0

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

Ian Vink
  • 66,960
  • 104
  • 341
  • 555

1 Answers1

2

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);
Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • 1
    You can alternatively create you own sizing source by overriding CreateSizingSource() and in your source override GetViewForHeader(). But still, you'd end up creating the view from scratch. – Krumelur Oct 16 '12 at 06:54