> On 26 Nov 2014, at 13:15, Ken Thomases <k...@codeweavers.com> wrote: > > On Nov 25, 2014, at 11:50 PM, Gerriet M. Denkmann <gerr...@mdenkmann.de> > wrote: > >> Document based Cocoa app; Window has CustomView inside ScrollView; uses >> autolayout. 10.10.1 >> >> Problem: the autolayout stuff keeps butting in and setting the frameSize of >> my CustomView to (0,0). >> >> So I need some method like: autolayoutHasFinishedItsWork, but cannot find >> such. > > What would you do in such a method if it existed? Set the view's frame size? > Well, you shouldn't be doing that if you're using auto layout.
The window has besides the CustomView a Zoom-slider, which does: ClipView is the super view of myCustomView. NSSize newSize = NSMakeSize( clipViewBounds.size.width * zoomValue, clipViewBounds.size.height ); [ self.myCustomView setFrameSize: newSize ]; This works fine, once the initial auto-layout stuff has finished. > If auto layout is setting your view's frame size to (0, 0) that's because it > doesn't have an intrinsic size and you haven't set up any constraints to make > it have a different size. What size should the view have? How would that be > derived? Initially CustomView-size = ClipView-size; later depending on zoom-slider (see above). > Finally, have you considered leaving > translatesAutoresizingMaskIntoConstraints set to YES for the view and setting > its autoresizing mask? In that case, calls to set the frame will establish > constraints that will maintain that new frame as per the old > springs-and-struts model of the autoresizing mask. Have not, but will investigate. Thanks for the suggestion! Kind regards, Gerriet. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com