美文网首页
ZMJGanttChart 表格sdk问题

ZMJGanttChart 表格sdk问题

作者: adaodao3056 | 来源:发表于2021-08-04 15:05 被阅读0次

    ZMJGanttChart 当column 的宽度不一样时 merge后的宽度计算不准 问题处理

    修改源码 "ZMJLayoutEngine.h" 文件

    image.png
            ZMJCellRange *mergedCell = [self.spreadsheetView mergedCellFor:[Location locationWithRow:row column:column]];
            if (mergedCell) {
                CGFloat cellWidth  = 0;
                CGFloat cellHeight = 0;
                if (!CGSizeEqualToSize(CGSizeZero, mergedCell.size)) {
                    cellWidth  = mergedCell.size.width;
                    cellHeight = mergedCell.size.height;
                } else {
                    for (NSInteger col = mergedCell.from.column; col <= mergedCell.to.column; ++col) {
                        cellWidth += self.columnWidthCache[col].floatValue + self.intercellSpacing.width;
                    }
                    for (NSInteger r = mergedCell.from.row; r <= mergedCell.to.row; ++r) {
                        cellHeight += self.rowHeightCache[r].floatValue + self.intercellSpacing.height;
                    }
                    mergedCell.size = CGSizeMake(cellWidth, cellHeight);
                }
    
    

    相关文章

      网友评论

          本文标题:ZMJGanttChart 表格sdk问题

          本文链接:https://www.haomeiwen.com/subject/kdeuvltx.html