簡體   English   中英

如何知道集合視圖大綱何時展開?

[英]How to know when a collection view outline has been expanded?

我正在使用大綱視圖樣式UICollectionView設置並設置我的 header 單元格,如下所示:

var content = cell.defaultContentConfiguration()
content.text = brand.name ?? "Unknown"
cell.contentConfiguration = content
  
let headerDisclosureOption = UICellAccessory.OutlineDisclosureOptions(style: .header)
cell.accessories = [.outlineDisclosure(options: headerDisclosureOption)]

但是,每當展開單元格部分時,是否有可能收到類似委托調用的內容? 每當擴展列表時,我都想從 inte.net 中提取新數據。

使用 diffable 數據源的sectionSnapshotHandlers屬性。 它是一個 SectionSnapshotHandlers 實例,一個完全由值為函數的屬性組成的結構。 您分配的那些功能是您的回調。

請參閱https://developer.apple.com/documentation/uikit/uicollectionviewdiffabledatasource/3600966-sectionsnapshothandlers

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM