• 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
Re: layout method not getting called on Content View
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: layout method not getting called on Content View
      • From: Dave <email@hidden>
References: 
 >layout method not getting called on Content View (From: Dave <email@hidden>)
 >Re: layout method not getting called on Content View (From: Kyle Sluder <email@hidden>)
 >Re: layout method not getting called on Content View (From: Dave <email@hidden>)
 >Re: layout method not getting called on Content View (From: David Duncan <email@hidden>)
 >Re: layout method not getting called on Content View (From: Dave <email@hidden>)
 >Re: layout method not getting called on Content View (From: email@hidden)
 >Re: layout method not getting called on Content View (From: Dave <email@hidden>)

  • Prev by Date: Re: Master - Detail: How to get back?
  • Next by Date: Re: layout method not getting called on Content View
  • Previous by thread: Re: layout method not getting called on Content View
  • Next by thread: Re: layout method not getting called on Content View
  • Index(es):
    • Date
    • Thread