Re: Auto-layout, Forcing a top-level view to hug its contents

2022-11-05 Thread Steve Christensen via Cocoa-dev
It should be fine if the view is offscreen as long as it’s part of the active 
view hierarchy. I would also suggest looking at the view controller 
viewDidLayoutSubviews() method to see if you could do what you want there.

> On Nov 4, 2022, at 9:25 PM, Sandor Szatmari  
> wrote:
> 
>> On Nov 4, 2022, at 23:05, Steve Christensen via Cocoa-dev 
>>  wrote:
>> 
>> The view hierarchy doesn’t go through a layout pass until after it is added 
>> to a live view or window. At awakeFromNib time it’s still essentially a 
>> snapshot of the layout in the nib since it hasn’t yet been inserted into the 
>> “context” that will allow the layout engine to determine how big all the 
>> views actually need to be.
> 
> Would an offscreen view or window allow it to be laid out and examine prior 
> to insertion in a live view/window?  Assuming this was necessary… of course.
> 
> 
> Sandor
> 
>>> On Nov 3, 2022, at 5:39 PM, Eyal Redler via Cocoa-dev 
>>>  wrote:
>>> 
>>> I have a view in a nib, the constraints are setup so that the view should 
>>> expand/contract to fit the contents and the nib is localized for several 
>>> languages. When I check the frame size of the view in awakeFromNib the size 
>>> I get is the same as the size set in the nib.
>>> I tried forcing the view to resize by calling layout but this didn't change 
>>> the frame size.
>>> Is there a way to force the view to resize, before putting it on the screen?
>>> 
>>> TIA
>>> 
>>> Eyal Redler
>>> 
>>> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
>>> way."
>>> --James Randi
>>> www.eyalredler.com

___

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


Re: Auto-layout, Forcing a top-level view to hug its contents

2022-11-04 Thread Sandor Szatmari via Cocoa-dev

> On Nov 4, 2022, at 23:05, Steve Christensen via Cocoa-dev 
>  wrote:
> 
> The view hierarchy doesn’t go through a layout pass until after it is added 
> to a live view or window. At awakeFromNib time it’s still essentially a 
> snapshot of the layout in the nib since it hasn’t yet been inserted into the 
> “context” that will allow the layout engine to determine how big all the 
> views actually need to be.

Would an offscreen view or window allow it to be laid out and examine prior to 
insertion in a live view/window?  Assuming this was necessary… of course.


Sandor

> 
>> On Nov 3, 2022, at 5:39 PM, Eyal Redler via Cocoa-dev 
>>  wrote:
>> 
>> I have a view in a nib, the constraints are setup so that the view should 
>> expand/contract to fit the contents and the nib is localized for several 
>> languages. When I check the frame size of the view in awakeFromNib the size 
>> I get is the same as the size set in the nib.
>> I tried forcing the view to resize by calling layout but this didn't change 
>> the frame size.
>> Is there a way to force the view to resize, before putting it on the screen?
>> 
>> TIA
>> 
>> Eyal Redler
>> 
>> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
>> way."
>> --James Randi
>> www.eyalredler.com
> 
> ___
> 
> 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/admin.szatmari.net%40gmail.com
> 
> This email sent to admin.szatmari@gmail.com
___

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


Re: Auto-layout, Forcing a top-level view to hug its contents

2022-11-04 Thread Steve Christensen via Cocoa-dev
The view hierarchy doesn’t go through a layout pass until after it is added to 
a live view or window. At awakeFromNib time it’s still essentially a snapshot 
of the layout in the nib since it hasn’t yet been inserted into the “context” 
that will allow the layout engine to determine how big all the views actually 
need to be.

> On Nov 3, 2022, at 5:39 PM, Eyal Redler via Cocoa-dev 
>  wrote:
> 
> I have a view in a nib, the constraints are setup so that the view should 
> expand/contract to fit the contents and the nib is localized for several 
> languages. When I check the frame size of the view in awakeFromNib the size I 
> get is the same as the size set in the nib.
> I tried forcing the view to resize by calling layout but this didn't change 
> the frame size.
> Is there a way to force the view to resize, before putting it on the screen?
> 
> TIA
> 
> Eyal Redler
> 
> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
> way."
> --James Randi
> www.eyalredler.com

___

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


Auto-layout, Forcing a top-level view to hug its contents

2022-11-03 Thread Eyal Redler via Cocoa-dev
I have a view in a nib, the constraints are setup so that the view should 
expand/contract to fit the contents and the nib is localized for several 
languages. When I check the frame size of the view in awakeFromNib the size I 
get is the same as the size set in the nib.
I tried forcing the view to resize by calling layout but this didn't change the 
frame size.
Is there a way to force the view to resize, before putting it on the screen?

TIA

Eyal Redler

"If Uri Geller bends spoons with divine powers, then he's doing it the hard 
way."
--James Randi
www.eyalredler.com


___

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