3

如何将 aUISegmentedControl放入 MonoTouch.Dialog 标题部分?

4

1 回答 1

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);
    }
}
于 2011-11-18T17:53:12.413 回答