void CreateItemLayoutTable(int itemCount) { float w = (itemWidth + itemMargin.left + itemMargin.right) * colItemCount; rowItemCount = itemCount / colItemCount; int m = itemCount % colItemCount; if (m > 0) { rowItemCount--; } float contentHeight = rowItemCount * (itemHeight + itemMargin.top + itemMargin.bottom); //// itemLayoutTable = new TableEx(rowItemCount, colItemCount); itemLayoutTable.SetTablePosition(0, 0); itemLayoutTable.SetTableSize(w, contentHeight); itemLayoutTable.ReLayout(); }
void CreateViewLayoutTable(int itemCount) { float w = (itemWidth + itemMargin.left + itemMargin.right) * colItemCount; rowItemCount = itemCount / colItemCount; int m = itemCount % colItemCount; if (m > 0) { rowItemCount--; } float contentHeight = rowItemCount * (itemHeight + itemMargin.top + itemMargin.bottom); float viewHeight = headerHeight + contentViewHeight; viewLayoutTable = new TableEx(2, 1); viewLayoutTable.SetTablePosition(0, 0); viewLayoutTable.SetTableSize(w, viewHeight); TableLine tableLine = new TableLine(LineDir.HORIZONTAL); tableLine.lineComputeMode = LineComputeMode.ABSOLUTE; tableLine.computeParam = headerHeight; viewLayoutTable.SetLineArea(0, tableLine); tableLine.computeParam = contentViewHeight; viewLayoutTable.SetLineArea(1, tableLine); // itemContentLayoutTable = headerLayoutTable = new TableEx(0, headerNames.Count()); itemContentLayoutTable.SetTableSize(w, headerHeight); viewLayoutTable.AddCellChildTable(0, 0, headerLayoutTable); // SetTableData(); viewLayoutTable.ReLayout(); }