コード例 #1
0
ファイル: TableView.cs プロジェクト: MF-JIN/test
        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;
            }
        }
コード例 #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);
        }