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.

enter image description here

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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -