PureLayout を使用して制約を作成しています
のcellForItemAtIndexPath
if (!_itemDetails){
_itemDetails = cell.itemDetails;
_itemDetailsConstraint = [_itemDetails autoPinEdge:ALEdgeBottom toEdge:ALEdgeBottom ofView:cell.imageView];
}
そして、scrollDidView
float scrollViewHeight = self.collectionView.frame.size.height;
float scrollOffset = self.collectionView.contentOffset.y;
if(_itemDetails){
if (scrollOffset + scrollViewHeight < CGRectGetMaxY(_frontImageView.frame)){
_itemDetailsConstraint.constant = CGRectGetMaxY(_frontImageView.frame) - (scrollOffset + scrollViewHeight);
}
else{
_itemDetailsConstraint.constant = 0;
}
}
[_itemDetails.superview layoutIfNeeded];
デバッグ中に制約の定数が変更されたことがわかりますが、ビューは新しい場所に更新されません。
私も試しました
[self.view layoutIfNeeded]
と
[self.collectionView layoutIfNeeded]
_itemDetails
ビューの ( のビューを指しているCollectionViewCell
) ロケーションを更新するにはどうすればよいですか?