0
我有一個UITableViewController和每個部分中的複選框列表。什麼是正確的方式來如何刪除UITableViewController中「其他行」的複選標記
- 取行的部分
- 更改部分的複選框,這樣我正確地更新我的支持數據視圖,以及UX看法呢?
...換句話說,我想部分1.我用NSIndexPath試圖內只有一個勾選然而屬性爲只讀。
代碼
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
if (indexPath.Section ==1)
{
var thisCell = tableView.CellAt(indexPath);
if (thisCell.Accessory == UITableViewCellAccessory.None)
thisCell.Accessory = UITableViewCellAccessory.Checkmark;
else
thisCell.Accessory = UITableViewCellAccessory.None;
}
if (indexPath.Section ==2)
{
var thisCell = tableView.CellAt(indexPath);
if (thisCell.Accessory == UITableViewCellAccessory.None)
{
thisCell.Accessory = UITableViewCellAccessory.Checkmark;
// Somehow deselect all the checkboxes in the other rows
// I can't set NSIndexPath properties on a new object... so I'm stuck
}
else
{
thisCell.Accessory = UITableViewCellAccessory.None;
}
}
}