【问题标题】:MonoTouch: UISegmentedControl in a MonoTouch.Dialog header?MonoTouch:MonoTouch.Dialog 标头中的 UISegmentedControl?
【发布时间】:2011-11-20 04:53:36
【问题描述】:

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

【问题讨论】:

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


    【解决方案1】:

    是的,您可以像操作任何常规 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);
        }
    }
    

    【讨论】:

    • 大声笑我想知道为什么它没有出现。当你想看到一些东西出现时,总是很方便地添加片段......#doh
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-02
    • 2011-11-01
    • 2013-09-24
    • 2012-05-15
    相关资源
    最近更新 更多