How to determine height of UICollectionView with FlowLayout

前端 未结 13 2105
醉话见心
醉话见心 2020-11-28 18:01

I\'ve got an UICollectionView with an UICollectionViewFlowLayout, and i want to calculate its content size (for return in intrinsicContentSiz

13条回答
  •  孤独总比滥情好
    2020-11-28 18:42

    This answer is based on @Er. Vihar's answer. You can easily implement the solution by using RxSwift

         collectionView.rx.observe(CGSize.self , "contentSize").subscribe(onNext: { (size) in
            print("sizer \(size)")
        }).disposed(by: rx.disposeBag)
    

提交回复
热议问题