我使用WWDC中的代码添加了徽章。但是徽章显示在单元格下面。 然后,如果我滚动,它会闪烁并且有时变得可见,而其他时候则停留在后面。 这是错误吗?
let badgeAnchor = NSCollectionLayoutAnchor(edges: [.bottom, .trailing], fractionalOffset: CGPoint(x: 0.3, y: 0.3))
let badgeSize = NSCollectionLayoutSize(widthDimension: .absolute(30),
heightDimension: .absolute(30))
let badge = NSCollectionLayoutSupplementaryItem(
layoutSize: badgeSize,
elementKind: "Tick",
containerAnchor: badgeAnchor)
let item = NSCollectionLayoutItem(layoutSize: itemSize,supplementaryItems: [badge])
group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem:item, count: sectionLayoutKind.columnCount)