swift3 - When UICollectionViewFlowLayout is used, can I change the vertical size of the header (referenceSizeForHeaderInSection)? -
god taught me. 1 simpler.
@iboutlet var aa: uicollectionview! . . override func viewdidappear(_ animated: bool) { aa.reloaddata()
i did :)
override func viewdidappear(_ animated: bool) { xxx=2000 let aa = self.view.viewwithtag(1) as! uicollectionview aa.reloaddata()
when uicollectionviewflowlayout used, can change vertical size of header (referencesizeforheaderinsection)? in following code, vertical size of collectionview's header not become 2000. want change vertical size of header after viewdidappear.
is there solution addsubview uicollectionview , view uiscrollview?
or use uicollectionviewlayout (custom)? want change vertical size of header. .
class testo: uiviewcontroller,uicollectionviewdatasource,uicollectionviewdelegate,uicollectionviewdelegateflowlayout { var xxx:cgfloat=1000 . . override func viewwillappear(_ animated: bool) { } override func viewdidappear(_ animated: bool) { xxx=2000 self.view.setneedslayout() self.view.layoutifneeded() } func collectionview(_ collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, referencesizeforheaderinsection section: int) -> cgsize { return cgsize(width:self.view.frame.width, height:xxx) }
Comments
Post a Comment