我在UICollectionView中使用多方向滚动和自定义流布局来创建数字表。
表的结构应该是这样的。一个数字表,其在最后一行中具有总和值:
现在表的第一列和第一行是静态的,即粘性的。我希望最后一行也可以粘贴在视图的底部。请帮助我。
这是我目前对该表的看法:
提前谢谢你。
答案 0 :(得分:1)
if section == sectionCount-1 {
for item in 0...rowCount-1 {
let indexPath = IndexPath(item: item, section: section)
if let attrs = cellAttrsDictionary[indexPath] {
var frame = attrs.frame
if item == 0 {
// Assigning the size of the first column as 200
frame.size.width = 200
frame.origin.x = xOffset
}
// Configuration for the last row in the last cell.
// Subtracting the Cell height from the entire Collection View height and assigning it as the frame for the last row of the Table i.e precisely on Y position.
frame.origin.y = (collectionView?.frame.size.height)! + yOffset - CGFloat(CELL_HEIGHT)
attrs.frame = frame
}
}
}