前提是collectionview需要展示出來(不一定是在屏幕上顯示), 獲取高度才管用. height = self.colletionview.collectionViewLayout.collectionViewContentSize