public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(NoteTextTagViewCell.Key) as NoteTextTagViewCell; if (cell == null) { cell = NoteTextTagViewCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; Tag tag = tagList[indexPath.Row]; cell.ContentView.Add(new DoubleCircleView(5, 6, ColorUtil.ConvertFromHexColorCode(tag.AnnoTag.Color), UIColor.White, 15, 16)); cell.TagNameLabel.Text = tag.AnnoTag.Title; cell.TintColor = UIColor.Red; cell.Accessory = tag.IsSelected?UITableViewCellAccessory.None:UITableViewCellAccessory.Checkmark; return(cell); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { NoteTextTagViewCell cell = (NoteTextTagViewCell)tableView.CellAt(indexPath); tagList[indexPath.Row].IsSelected = !tagList [indexPath.Row].IsSelected; Tag tag = tagList [indexPath.Row]; if (cell.Accessory == UITableViewCellAccessory.None) { tagGuidList.Add(tag.AnnoTag.TagId); AppDisplayUtil.Instance.noteVC.getGuidList = tagGuidList; } else if (cell.Accessory == UITableViewCellAccessory.Checkmark) { if (tagGuidList.Count != 0) { tagGuidList.Remove(tag.AnnoTag.TagId); AppDisplayUtil.Instance.noteVC.getGuidList = tagGuidList; } } tableView.ReloadData(); }