我目前正在使用UICollectionView开发一个应用程序。我需要知道contentSize的高度,我正在通过
self.collectionView.collectionViewLayout.collectionViewContentSize.height现在,这是有效的,但返回值对于纵向模式并不总是正确的。我应该怎么做才能实现我需要的东西?
发布于 2013-02-19 00:02:27
只需在viewDidAppear和didRotateFromInterfaceOrientation中获取self.collectonView.contentSize
- (void)viewDidAppear:(BOOL)animated{
NSLog(@"%0.0f-%0.0f",self.collectionView.contentSize.width,self.collectionView.contentSize.height);
}
-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{
NSLog(@"%0.0f-%0.0f",self.collectionView.contentSize.width,self.collectionView.contentSize.height);
}https://stackoverflow.com/questions/14939879
复制相似问题