1

我知道通过简单地使用 MonoTouch.Dialog 高级反射 API 很容易Enum做到这一点,但是如何使用低级元素 API 来完成呢?我似乎无法找到一种为EntryElement项目提供数据源的方法。我要解决这个问题了吗?

4

1 回答 1

2

你可以看看反射 API 是如何做到的,它实际上非常简单,它只是创建一个 RootElement,然后用它需要的各种值填充它。

像这样的东西:

var section = new Section ("My Section");
for (int i = 0; i < 32; i++){
    section.Add (new RadioElement ("Element " + i));
}

var myRadio = new RootElement ("My Radio", new RadioGroup (null, 0)) { 
   section 
};
于 2012-10-13T02:32:41.057 回答