本文介绍了Monotouch.Dialog两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是MonoTouch的新手.我需要使用 monotouch.dialog
在1个视图中显示2个表和它们之间的按钮.看起来应该像
I'm new to MonoTouch. I need to display 2 tables and button between them in 1 view using monotouch.dialog
. It should looks like
---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
I have searched over an internet - But nothing similar to find. :( The problem is to display last strigElement
推荐答案
通过MonoTouch.Dialog,您可以使用类似以下内容的东西:
With MonoTouch.Dialog you can use something like:
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
在 HeaderView
内添加 UIButton
.可以使用相同的技巧来添加任何其他类型的控件.
That will use a Section
to add an UIButton
inside the HeaderView
. The same trick can be used to add any other kind of control.
这篇关于Monotouch.Dialog两个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!