HDCollectionView icon indicating copy to clipboard operation
HDCollectionView copied to clipboard

tableCell 嵌套瀑布流时,在赋值的过程中出现了问题,必须多次调用后才会显示内容

Open bilibili11 opened this issue 8 months ago • 1 comments

var cellData:Any?{ didSet{

        guard let cellData = cellData as? ZZZ_HomeNoisePresetList else { return  }
        titlab.text = cellData.preset_cate_name
        //该段layout
        let layout = HDWaterFlowLayout()
        layout.secInset      = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 0)
        layout.verticalGap   = 16;
        layout.horizontalGap = 16;
        layout.headerSize    = .zero;
        layout.footerSize    = .zero;
        layout.columnRatioArr =  [NSNumber(integerLiteral: 1),NSNumber(integerLiteral: 1)]
        layout.decorationMargin = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
        let hdCellModels = cellData.noise_data.map { list in
            let model = HDCellModel()
            model.orgData = list
            model.cellClassStr = "ZZZ_HomeDoubleCollectionCell"
            model.cellSize = CGSize(width: WIDTH * 0.62, height: 82)
            return model
        }
        //该段的所有数据封装
        let secModel = HDSectionModel();
        secModel.sectionDataArr        = NSMutableArray(array: hdCellModels)
        secModel.layout                = layout
        listV.hd_setAllDataArr([secModel])
    }
}

bilibili11 avatar Jun 06 '24 10:06 bilibili11