public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(HighlightTableViewControllerCell.Key) as HighlightTableViewControllerCell; if (cell == null) { cell = HighlightTableViewControllerCell.Create(); } cell.SelectionStyle = UITableViewCellSelectionStyle.None; Tag tag = AppDataUtil.Instance.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) { HighlightTableViewControllerCell cell = (HighlightTableViewControllerCell)tableView.CellAt(indexPath); tagList[indexPath.Row].IsSelected = !tagList [indexPath.Row].IsSelected; Tag tag = tagList [indexPath.Row]; if (cell.Accessory == UITableViewCellAccessory.None) { Guid tagId = AnnCategoryTagUtil.Instance.AddTag(tag.AnnoTag.Title, tag.AnnoTag.Color); tagGuidList.Add(tagId); AppDisplayUtil.Instance.highlightVC.getGuidList = tagGuidList; } else if (cell.Accessory == UITableViewCellAccessory.Checkmark) { if (tagGuidList.Count != 0) { tagGuidList.RemoveAt(indexPath.Row); AppDisplayUtil.Instance.highlightVC.getGuidList = tagGuidList; } } tableView.ReloadData(); }