答案 0 :(得分:2)
只需在您的collectionviewcell点击
时调用此方法int width = view->verticalHeader()->width() + view->horizontalHeader()->width() + view->frameWidth()*2;
int height= view->horizontalHeader()->height() + view->verticalHeader()->height() + view->frameWidth()*2;
答案 1 :(得分:1)
基于Himanshu Moradiya解决方案的 swift 3 :
func animateZoomforCell(zoomCell : UICollectionViewCell)
{
UIView.animate(
withDuration: 0.2,
delay: 0,
options: UIViewAnimationOptions.curveEaseOut,
animations: {
zoomCell.transform = CGAffineTransform.init(scaleX: 1.2, y: 1.2)
},
completion: nil)
}
func animateZoomforCellremove(zoomCell : UICollectionViewCell)
{
UIView.animate(
withDuration: 0.2,
delay: 0,
options: UIViewAnimationOptions.curveEaseOut,
animations: {
zoomCell.transform = CGAffineTransform.init(scaleX: 1.0, y: 1.0)
},
completion: nil)
}