Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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);
        }