MonoTouch:MonoTouch.Dialog标头中的UISegmentedControl?

时间:2011-11-18 09:29:01

标签: iphone ios xamarin.ios uisegmentedcontrol monotouch.dialog

如何在MonoTouch.Dialog标题部分放置UISegmentedControl

1 个答案:

答案 0 :(得分:3)

是的,您可以像处理任何常规UIView一样操纵Section类的HeaderView成员:

public class SegmentedSection : Section
{
    UISegmentedControl _SegmentedControl;

    public SegmentedSection()
        : base("")
    {
        InitializeSection();
    }

    private void InitializeSection()
    {
        _SegmentedControl = new UISegmentedControl();

        // initialize _SegmenentedControl here...
        // make sure to set Frame appropriate relative to HeaderView bounds.

        this.HeaderView.AddSubview(_SegmentedControl);
    }
}