ios - Auto Layout Constraint from UICollectionViewCell to View from ViewController -
i have uicollectionview can scroll horizontally. cell add constraint main view viewcontroller.
because cell of uicollectionview , not subview, xcode report error hierarchy wrong. how that?
edit :
the purpose or effect want :
i have uicollectionview scrolling horizontal. cells of collection view screen pages. on screens labels. when user scroll through pages in collection view label scroll left/right edge of screen stay there , disappear page. group table view section header horizontally.
thanks answers, nothing works me. did create 2 constraints:
cell.left equal label.left : priority 499 cell.right greateorequal label.right
i save left constraint on scroll move did:
- (void) scrolloffsetchange: (cgpoint) offset { int x = abs(((int)offset.x%(int)self.frame.size.width)); self.toplableleftconstraint.constant = x; self.toplabels.alpha = 1 - (x/self.frame.size.width)*(x/self.frame.size.width); [self layoutifneeded]; }
and ended disappear effect.
Comments
Post a Comment