1

我需要在某行旁边打勾,但是当使用此覆盖时,我当然会收到以下警告。然后在 MonoTouch.Dialog 的哪个位置启用检查?

public override UITableViewCellAccessory AccessoryForRow (UITableView tableView, NSIndexPath indexPath)
{       
  return UITableViewCellAccessory.Checkmark; (For a row of course, simplified here)
}

警告:由于 tableView:accessoryTypeForRowWithIndexPath: 的委托实现而使用旧版单元格布局请删除此方法的实现并设置单元格属性accessoryType 和/或editingAccessoryType 以移动到新的单元格布局行为。

4

1 回答 1

2

此方法已弃用,如果您需要使用此方法,则需要通过在其上设置 AccessoryType 和 AccessoryView 属性来相应地配置您的 UITableViewCells。

只需创建一个新的 Element 类来实现您需要的行为,查看我最近关于构建元素模式的博客:

http://tirania.org/monomac/archive/2011/Jan-18.html

于 2011-01-26T05:19:57.447 回答