private void CreateLayoutIfNeededForCellWithSize(TableViewCell cell, float size) { LayoutElement layoutElement = cell.GetComponent <LayoutElement>(); if (layoutElement == null) { layoutElement = cell.gameObject.AddComponent <LayoutElement>(); } layoutElement.preferredHeight = 0; layoutElement.preferredWidth = 0; if (isVertical) { layoutElement.preferredHeight = size; } else { layoutElement.preferredWidth = size; } }
public void GenerateCellContent(TableViewCell cell) { cell.ContentTemplate = CellTemplate; cell.HorizontalContentAlignment = HorizontalContentAlignment; if (ContextBinding == null && ContextBindingPath != null) ContextBinding = new Binding(ContextBindingPath); if (ContextBinding != null) BindingOperations.SetBinding(cell, DataContextProperty, ContextBinding); }