【问题标题】:Is it possible to create a Checkbox Selection list using MonoTouch.Dialog?是否可以使用 MonoTouch.Dialog 创建复选框选择列表?
【发布时间】:2011-09-20 05:14:54
【问题描述】:

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

类似这样的:

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

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

【问题讨论】:

    标签: iphone xamarin.ios monotouch.dialog


    【解决方案1】:

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

    【讨论】:

    • 好吧,我就是这么想的。源代码中的某些部分使这看起来可能已经成为可能,所以我只想在继续之前检查一下。谢谢。
    【解决方案2】:

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

    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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-02
      • 2020-08-06
      • 2016-02-29
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多