0

基本上,我想要使用 RadioSelection 属性获得的相同功能,只是它允许进行多项选择。

像这样的东西:

[CheckSelection]
private IList<int> currentSelections;
private IList<string> myList;

查看文档似乎没有提到这样的事情。所以我的问题是:可以使用当前版本的 MonoTouch.Dialog 创建复选框选择列表吗?如果是这样,那怎么办?如果没有,有没有更好的方法来处理这种情况?

4

2 回答 2

1

您必须扩展 MT.Dialog 才能做到这一点。

于 2011-09-20T15:28:59.310 回答
1

这是我用来实现此目的的方法:

var root new RootElement() { 
    new Section("Bacon"){ 
        new RootElement ("Types", new  RadioGroup (0)){ 
            new Section(){  
                new CheckboxElement ("Smokey"),  
                new CheckboxElement ("Streaky"), 
                new CheckboxElement ("Rasher")
            }   
        }
    } 
};

取自

http://monotouch.2284126.n4.nabble.com/MT-Dialog-multi-select-element-td4516738.html

于 2015-07-28T15:14:36.907 回答