Monotouch.对话二表



我是MonoTouch的新手。我需要使用monotouch.dialog在1视图中显示2个表和它们之间的按钮。它应该看起来像

---top of screen---
I BoolElement     I
I StringElement   I
I StringElement   I          <--- Yeah,yeah this is iPhone(in my Opinion)
I --empty space-- I
I button          I
I --empty space-- I
I StringElement   I
---End Of screen--

我已经在网上搜索过了-但是没有找到类似的。:(问题是显示最后一个strigElement

使用MonoTouch。对话框中,你可以使用:

    RootElement CreateRoot ()
    {
        var btn = new UIButton ();
        btn.TouchUpInside += delegate {
            Console.WriteLine ("touch'ed");
        };
        // TODO: customize button look to your liking
        // otherwise it will look like a text label
        btn.SetTitle ("button", UIControlState.Normal);
        Section s = new Section ();
        s.HeaderView = btn;
        return new RootElement (String.Empty) {
            new Section () {
                new BooleanElement ("bool", false),
                new StringElement ("s1"),
                new StringElement ("s2"),
                },
            new Section (),
            s,
            new Section () {
                new StringElement ("s3"),
            },
        };      
    }

将使用SectionHeaderView中添加UIButton。同样的技巧可以用于添加任何其他类型的控件。

最新更新