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