Re: More constraints confusion
Re: More constraints confusion
- Subject: Re: More constraints confusion
- From: Chuck Soper <email@hidden>
- Date: Thu, 25 Apr 2013 17:06:14 -0700
- Thread-topic: More constraints confusion
IB adds constraints to both the NSImageView and its superview. I believe
that this is why deleting a constraint causes it to come back (it's in two
views).
Here's what I recommend:
- Delete the NSImageView which will also delete the associated constraints.
- Drag a new NSImageView to the window (i.e. the main view of the window).
- Resize the NSImageView to fit inside the frame of its containing view.
- Select NSImageView, by double clicking on the NSImageView in the list of
objects. Now, from the Editor menu select "Align -> Horizontal Center in
Container" and "Align -> Vertical Center in Container." (You can also do
that by clicking on the leftmost icon of the constraints control at the
bottom right of the IB view.)
That should do it. Adding those alignment constraints deleted the trailing
and bottom constraints.
Chuck
On 4/25/13 4:39 PM, "Rick Mann" <email@hidden> wrote:
>I put an NSImageView into a window. I want the NSImageView's frame to
>always fill the window content frame.
>
>When I dropped it in, IB gave it a width and height constraint that I
>can't edit. I sized it to fit the window, and it also added leading and
>trailing space constraints.
>
>I explicitly set top and bottom constraints.
>
>But the width & height constraints can't be edited. If I promote them to
>user constraints, and then try to delete them, they just come back.
>
>Why does IB think they are necessary?
>
>--
>Rick
>
>
>
>
>_______________________________________________
>
>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
_______________________________________________
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