You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,I have a question.Just I use UICollectionViewCompositionalLayout,in which there are multiple items in group.How can I use this kit to slide to edit the whole group instead of a single cell?
Here is my layout code:
func layoutConfig()-> UICollectionViewCompositionalLayoutConfiguration
{
let config = UICollectionViewCompositionalLayoutConfiguration()
config.interSectionSpacing = 30
return config
}
func comboLayout()->UICollectionViewCompositionalLayout
{
let layout = UICollectionViewCompositionalLayout.init { section, environment in
return self.generateSection(section: section)
}
layout.register(DODecorationView.self, forDecorationViewOfKind: "background")
return layout
}
func generateSection(section:NSInteger)->NSCollectionLayoutSection
{
let sectionModel = self.listModel[section]
var group : NSCollectionLayoutGroup
var behavior : UICollectionLayoutSectionOrthogonalScrollingBehavior = .continuous
var bannerItemSize = NSCollectionLayoutSize.init(widthDimension: NSCollectionLayoutDimension.fractionalWidth(1), heightDimension: NSCollectionLayoutDimension.fractionalHeight(1))
var bannerItem = NSCollectionLayoutItem.init(layoutSize: bannerItemSize)
var bannerGroupSize : NSCollectionLayoutSize
bannerItem.contentInsets = NSDirectionalEdgeInsets.init(top: 0, leading: 0, bottom: 0, trailing: 0)
bannerGroupSize = NSCollectionLayoutSize.init(widthDimension: NSCollectionLayoutDimension.absolute(kScreenWidth-20), heightDimension: NSCollectionLayoutDimension.absolute(450))
group = NSCollectionLayoutGroup.custom(layoutSize: bannerGroupSize, itemProvider: { layoutEnvironment in
var customers = [NSCollectionLayoutGroupCustomItem]()
let itemHeader = NSCollectionLayoutGroupCustomItem.init(frame: CGRect.init(x: 0, y: 0, width: kScreenWidth-20, height: 100), zIndex: 1001)
customers.append(itemHeader)
let itemScrol = NSCollectionLayoutGroupCustomItem.init(frame: CGRect.init(x: 0, y: 100, width: kScreenWidth-100-20, height: 200), zIndex: 1002)
customers.append(itemScrol)
let itemInfo = NSCollectionLayoutGroupCustomItem.init(frame: CGRect.init(x: kScreenWidth-100-20, y: 100, width: 100, height: 200), zIndex: 1003)
customers.append(itemInfo)
let itemFooter = NSCollectionLayoutGroupCustomItem.init(frame: CGRect.init(x: 0, y: 300, width: kScreenWidth-20, height: 150), zIndex: 1004)
customers.append(itemFooter)
return customers
})
var sectionInsets = NSDirectionalEdgeInsets.init(top: 10, leading: 10, bottom: 10, trailing: 10)
var laySection = NSCollectionLayoutSection(group: group)
laySection.orthogonalScrollingBehavior = behavior
laySection.contentInsets = sectionInsets
return laySection
}
The text was updated successfully, but these errors were encountered:
Hello,I have a question.Just I use UICollectionViewCompositionalLayout,in which there are multiple items in group.How can I use this kit to slide to edit the whole group instead of a single cell?
Here is my layout code:
func layoutConfig()-> UICollectionViewCompositionalLayoutConfiguration
{
let config = UICollectionViewCompositionalLayoutConfiguration()
config.interSectionSpacing = 30
return config
}
The text was updated successfully, but these errors were encountered: