• 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: autoresizing problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoresizing problem


  • Subject: Re: autoresizing problem
  • From: Daniel Jalkut <email@hidden>
  • Date: Wed, 26 Oct 2005 19:32:18 -0400

Hi Craig, it doesn't sound exactly like the problem I recently had:

http://www.red-sweater.com/blog/?p=35

But learning from my experience, what I would do in your situation is go through and examine the view hierarchy to ensure that every parent view up through the window's content view is configured to "autoresizesSubviews" set to YES. It sounds like they are, or else you wouldn't get view A to resize during the second case (or does it?).

If everybody is set up to to autoresizeSubviews, then what I'd play with next is switching up the order of your setAutosizesSubviews call on A. What happens if you set it to autosizeSubviews *before* adding the subview? There might be a funky bug you're witnessing based on assumptions made while embedding the view, based on the attributes of the parent view at that point.

In my experience (as testified to in my blog entry linked above) it can be a little unpredictable what you get with regard to autosizing when you step outside the usual "everything all set up in IB" league of behavior.

Daniel

On Oct 26, 2005, at 5:57 PM, Craig Hopson wrote:

I have a window which contains a view ('A'). For A the NSViewWidth & NSViewHeight autosize flags are set. When the window is resized, the view resizes appropriately in both dimensions.

I have a nib which contains a view ('B')
(which contains two sub views, one of which is embedded in a scroller).
For view B, the NSViewWidth autosize flag is set.


The nib file's owner is a controller, which has an outlet for B. When I create the controller, the nib is loaded. I then get B and call [ A addSubview:B ] followed by [ A setAutoResizeSubviews:YES ].

B is added to A. However, when I resize the window, B does not resize horizontally. Anyone have a guess what I'm missing?

BTW, I've tried probably every possible combination of autoresize flags for B in the nib. The behavior does not change, so I don't think the problem is just that I have the wrong flag set.

Thanks in advance,
-Craig
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >autoresizing problem (From: Craig Hopson <email@hidden>)

  • Prev by Date: Re: Accessor macros used by GNUstep but not Cocoa?
  • Next by Date: Re: Access to argc & argv
  • Previous by thread: autoresizing problem
  • Next by thread: Odd Runtime Message
  • Index(es):
    • Date
    • Thread