我有UIViewController
,内部使用UICollectionViewController
和单个按钮,我想在点击按钮时更改UICollectionViewControllerCell
,如高度和宽度。
答案 0 :(得分:0)
实现集合视图的委托
- (UICollectionViewTransitionLayout *)collectionView:(UICollectionView *)collectionView
transitionLayoutForOldLayout:(UICollectionViewLayout *)fromLayout
newLayout:(UICollectionViewLayout *)toLayout
并在按钮上使用IBAction更改高度和宽度的值。
答案 1 :(得分:0)
你可以尝试一次吗
[UIView transitionWithView:collectionView
duration:.5
options:UIViewAnimationOptionTransitionCurlUp
animations:^{
//any animatable attribute here.
cell.frame = CGRectMake(3, 14, 100, 100);
} completion:^(BOOL finished) {
//whatever you want to do upon completion
}];