• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Mutating NSLayoutConstraint -constant at run time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mutating NSLayoutConstraint -constant at run time


  • Subject: Mutating NSLayoutConstraint -constant at run time
  • From: Jonathan Mitchell <email@hidden>
  • Date: Mon, 26 May 2014 21:41:14 +0100

So:

1. I have a NSView V within a view hierarchy.
2. V holds a layout constraint C that offsets a subview S from the bottom edge of V.
3. At runtime I mutate -constant on constraint C.

The question is should the view hierarchy automatically recalculate its layout in response to changing the constant on C?

In practice I find that I have to call -layoutSubtreeIfNeeded on a superview of V.
I do not have to call -setNeedsLayout:YES

Note:

My actual implementation is more complex than the above.
V exists with an NSStackView subclass, so there are a lot of constraints at play.
However, if I can clarify the above it will help my thinking.


Jonathan












_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Re: UICollectionViewCell and UIScrollView and autolayout
  • Next by Date: Re: EXC_BAD_ACCESS in NSData
  • Previous by thread: Re: UICollectionViewCell and UIScrollView and autolayout
  • Next by thread: AVFoundation video not playing in root mode
  • Index(es):
    • Date
    • Thread