Xamarin.ios Monotouch.Dialog不支持在编辑过程中允许多重选择?

Xamarin.ios Monotouch.Dialog不支持在编辑过程中允许多重选择?,xamarin.ios,monotouch.dialog,Xamarin.ios,Monotouch.dialog,在使用Monotouch.Dialog进行编辑时,我不想使用UITableView.AllowsMultipleSelection。如果该属性设置为true,则在表上单击(启用编辑模式)似乎会被忽略(不进行选择)。如果有一个元素.Tapped,它将被执行。在我当前的实现中,它会将一个新的UIView推送到NavigationController,但这不是您在编辑模式下所期望的 您可以在monotouch.dialog-sample项目中重现该行为,只需将EditingDialog构造函数(Dem

在使用Monotouch.Dialog进行编辑时,我不想使用UITableView.AllowsMultipleSelection。如果该属性设置为true,则在表上单击(启用编辑模式)似乎会被忽略(不进行选择)。如果有一个元素.Tapped,它将被执行。在我当前的实现中,它会将一个新的UIView推送到NavigationController,但这不是您在编辑模式下所期望的

您可以在monotouch.dialog-sample项目中重现该行为,只需将EditingDialog构造函数(DemoEditing.cs:57)更改为以下内容:


    public EditingDialog (RootElement root, bool pushing) : base (root, pushing)
    {
      TableView.AllowsMultipleSelectionDuringEditing = true;
    }

有没有办法在编辑过程中使用AllowsMultipleSelection?如果是,我的方法有什么问题?

我自己的代码也有同样的问题。问题在于,某些MonoTouch.Dialog元素的单元格SelectionStyle设置为UITableViewCellSelectionStyle.None

我通过对Source或SizingSource进行分类来解决这个问题:

public class MyTableViewSource : Source
{
    public MyTableViewSource(DialogViewController container) : base(container)
    {
    }

    public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
    {
        var cell = base.GetCell(tableView, indexPath);
        cell.SelectionStyle = UITableViewCellSelectionStyle.Gray; // something other than None
        return cell;
    }
}
然后在对话框ViewController中:

public class MyDialogController : DialogViewController
{
    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        // setup root element
        Root = new RootElement();

        // . . .

        TableView.Source = new MyTableViewSource(this);
        TableView.AllowsMultipleSelectionDuringEditing = true;
    }
}

我自己的代码也有同样的问题。问题在于,某些MonoTouch.Dialog元素的单元格SelectionStyle设置为UITableViewCellSelectionStyle.None

我通过对Source或SizingSource进行分类来解决这个问题:

public class MyTableViewSource : Source
{
    public MyTableViewSource(DialogViewController container) : base(container)
    {
    }

    public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
    {
        var cell = base.GetCell(tableView, indexPath);
        cell.SelectionStyle = UITableViewCellSelectionStyle.Gray; // something other than None
        return cell;
    }
}
然后在对话框ViewController中:

public class MyDialogController : DialogViewController
{
    public override void ViewDidLoad()
    {
        base.ViewDidLoad();

        // setup root element
        Root = new RootElement();

        // . . .

        TableView.Source = new MyTableViewSource(this);
        TableView.AllowsMultipleSelectionDuringEditing = true;
    }
}

你能最终解决这个问题吗?我对此困惑了一段时间……对不起,我没听清你的评论。你还感兴趣吗?我做了一个变通方法,但我必须首先从我的存储库中获取它。不用担心,这是不真实的!我已经完全忘记了,我想我也想出了一个解决办法……你能最终解决这个问题吗?我对此困惑了一段时间……对不起,我没听清你的评论。你还感兴趣吗?我做了一个变通方法,但我必须首先从我的存储库中获取它。不用担心,这是不真实的!我已经完全忘记了,我想我也想出了一个解决办法。。。