Note that there are some explanatory texts on larger screens.

plurals
  1. POResizing UIView with autolayout when placed below a fixed size UIView
    primarykey
    data
    text
    <p>I am using autolayout with this layout:</p> <p><img src="https://i.stack.imgur.com/mqspM.png" alt="enter image description here"></p> <p>self.view with frame (0,80, 320, 488)</p> <p>collectionView with frame (0,0,320,220)</p> <p>underView with frame (0,220,320,268)</p> <p>and trying to achieve an animation which should resize underView enlarging its height such that underView partially covers collectionView moving bottom-up.</p> <p>Autolayout forces an height constraint for those 2 views hence I have created an IBOutlet for underView height constraint which I am tweaking in animation:</p> <pre><code>NSLog(@"underView height %.2f", self.underView.frame.size.height); NSLog(@"offset (%.2f, %.2f)", offset.x, offset.y); heightConstraint.constant += offset.y; NSLog(@"heightConstraint %.2f", heightConstraint.constant); [self.underView setNeedsUpdateConstraints]; [UIView animateWithDuration:ANIMATION_DURATION delay:ANIMATION_DELAY options:UIViewAnimationOptionCurveEaseOut animations:^{ [self.underView layoutIfNeeded]; NSLog(@"underView height %.2f", heightConstraint.constant); } completion:nil]; </code></pre> <p>And in the console I can see:</p> <pre><code>2013-07-30 09:09:37.268 Cal[49611:a0b] underView height 268.00 2013-07-30 09:09:37.268 Cal[49611:a0b] offset (320.00, 144.00) 2013-07-30 09:09:37.269 Cal[49611:a0b] heightConstraint 412.00 2013-07-30 09:09:37.270 Cal[49611:a0b] underView height 412.00 </code></pre> <p>But the resize does not happen at all.</p> <p>The only reason for this behavior I can think of is the height constraint of the collectionView above, but since I do not want the collection to reload I can not operate on that.</p> <p>I am wondering how to achieve having the underView enlarging OVER the collectionView? I tried using constraint priorities but it didn't work...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload