2011-11-28 53 views
1

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

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

+2

Off-Topic:Nice ASCII-Phone,我可以在哪里购买它? –

+0

致电Aplle,询问iPhone 5;) –

回答

3

随着MonoTouch.Dialog您可以使用类似:

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"), 
      }, 
     };  
    } 

将使用一个Section添加一个UIButtonHeaderView内相同的技巧可以使用添加任何其他类型的控件。

+0

谢谢,它帮助:) –