我是 MonoTouch 的新手。
我需要使用 monotouch.dialog
在 1 个 View 中显示 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--
我在互联网上搜索过 - 但找不到类似的东西。 :(
问题是显示最后一个 srigElement
最佳答案
使用 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
添加 UIButton
里面HeaderView
.相同的技巧可用于添加任何其他类型的控件。
关于c# - Monotouch.Dialog 两个表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8296548/