public void ConfigureCell(TableViewCell cell, int index) { RectTransform rt = cell.transform as RectTransform; rt.anchorMin = new Vector2(0, 1); rt.anchorMax = new Vector2(1, 1); rt.pivot = new Vector2(0, 1); int height = Spacer.GetSize(index); rt.sizeDelta = new Vector2(0, height); cell.SetShowAnchors(TextAnchor.UpperLeft, TextAnchor.UpperLeft); cell.SetHideAnchors(TextAnchor.UpperLeft, TextAnchor.UpperRight); }
void RemoveCellData(int index) { List <int> keys = SortedKeys(); for (int i = 0; i < keys.Count; ++i) { int key = keys[i]; if (key < index) { continue; } else if (key == index) { RemoveCellView(key); } else { Poolable item = cellPooler.Collection[key]; cellPooler.Collection.Remove(key); cellPooler.Collection.Add(key - 1, item); Vector2 offset = container.Flow.GetCellOffset(key); item.GetComponent <TableViewCell>().Pin(offset); } } int height = spacer.GetSize(index); spacer.Remove(index); visibleRange = container.Flow.GetVisibleCellRange(); for (int i = visibleRange.x; i <= visibleRange.y; ++i) { if (cellPooler.HasKey(i)) { continue; } TableViewCell cell = cellPooler.DequeueScriptByKey <TableViewCell>(i); Vector2 offset = container.Flow.GetCellOffset(i, height); cell.Pin(offset); } }