MonoTouch.Dialog:更改Section的颜色

时间:2012-10-15 00:07:19

标签: xamarin.ios monotouch.dialog

通常要在普通模式下更改剖面的特征(字体,颜色),我们必须从头开始创建整个视图。

如果需要对颜色/尺寸进行简单更改,是否有更简单的方法可以做到这一点?

这是我倾向于做的事情:

    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

1 个答案:

答案 0 :(得分:2)

这似乎是最简单的方法:

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);