Re: layout method not getting called on Content View
Re: layout method not getting called on Content View
- Subject: Re: layout method not getting called on Content View
- From: Quincey Morris <email@hidden>
- Date: Thu, 16 Apr 2015 16:49:00 +0000
On Apr 16, 2015, at 08:41 , Dave <email@hidden> wrote:
>
> Any advice on how to quickly achieve this would greatly appreciated, but it if means spending days reading documentation and experimenting just to set the frame of a view, then I may as well forget including this part in the demo and work on improving other parts of the application.
The difficulty is that you’ve never actually said what the problem was with *not* using autolayout. You wrote:
> On Apr 15, 2015, at 11:47 , Dave <email@hidden> wrote:
>
>> I have a WindowController/Window Combo contained in a NIB. Auto Layout is turned off and I want to alter to positions and/or sizes of views inside the ContentView. I thought the obvious place to do this was layout, but it never seems to get called?
Assuming that the subviews of the content view are already in the view hierarchy (they were there in the nib, or you just added them programmatically), and autolayout is turned off for the content view, then the way to set the size and position of the subviews is to call ‘setFrame:’ on each one. That’s the way it was done before autolayout existed, and it should still work just fine when autolayout is not turned on.
The ‘layout’ method *isn’t* the obvious or correct place to do this, because it’s API that belongs specifically to the autolayout ecosystem.
Did you try just setting the frames of your subviews?
_______________________________________________
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