【发布时间】:2013-01-17 16:48:50
【问题描述】:
我正在尝试为UICollectionView 动态设置节标题的高度,但是使用下面的代码,我没有看到任何变化。视图中包含正确的项目,但高度不会改变。抱歉,如果这是一个重复的问题,但我似乎找不到与 UICollectionView 对象特别相关的任何内容。提前致谢。
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView
viewForSupplementaryElementOfKind:(NSString *)kind
atIndexPath:(NSIndexPath *)indexPath
{
PhotoVideoHeaderCell *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader
withReuseIdentifier:@"videoHeaderView"
forIndexPath:indexPath];
if (indexPath.section == 0) {
// photos
[headerView setSection:@"Photo"];
} else {
[headerView.VehicleDetailView removeFromSuperview];
CGRect frame = headerView.frame;
frame.size.height = 60;
[headerView setFrame:frame];
[headerView setNeedsDisplay];
[headerView setBackgroundColor:[UIColor grayColor]];
[headerView setSection:@"Video"];
}
return headerView;
}
【问题讨论】:
标签: objective-c ios6 xcode4.5