• 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
Help needed with setting autoresizing masks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help needed with setting autoresizing masks


  • Subject: Help needed with setting autoresizing masks
  • From: WT <email@hidden>
  • Date: Fri, 29 May 2009 22:38:52 +0200

Hello list,

I've been scratching my head for a few hours already trying to get the autoresizing masks set correctly for the following situation, with no luck, and would greatly appreciate some help.

I have a view containing two labels, labelA and labelB, horizontally laid out in sequence, like this:

|..|labelA|....................|labelB|..|

The outermost bars represent the edges of the view, and the labels are inset by a fixed amount. The dots represent empty space.

When the user taps on the view, both labels slide inwards to provide space for two buttons, so the final position should look like this:

|..|btnA|..|labelA|....|LabelB|..|btnB|..|

I've already gotten all the code working correctly (I checked the math in general and with specific examples), the animated sliding works, and it's all great - except that labelB is intersecting btnB. At first I thought this was an error in my code or in the math, but that isn't it. The problem is with the autoresizing masks. I verified that by NOT changing the position of labelB in code and noticing that it still moves.

Of course, I could hack a solution by figuring out the extra horizontal displacement and subtracting that amount from the final x coordinate of labelB, but I'd rather get it right just by setting the right autoresizing masks.

I also tried turning off the "autoresize subviews" option in IB for the container view (and all 4 elements, not that that should matter), in the hopes that that would work since I compute the correct coordinates for all elements myself. Yet, it still didn't work.

You can see some pictures of the situation here:

http://www.restlessbrain.com/auto_res_mask/before_tap.png
http://www.restlessbrain.com/auto_res_mask/after_tap.png
http://www.restlessbrain.com/auto_res_mask/cell_on_IB.png
http://www.restlessbrain.com/auto_res_mask/mask.png

The mask picture applies to all labels on the other pictures.

Any help is appreciated.

Thanks!
Wagner
_______________________________________________

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: Help needed with setting autoresizing masks
      • From: Seth Willits <email@hidden>
  • Prev by Date: Re: Rearrange items on NSToolbar
  • Next by Date: NSURLRequest- setHTTPMethod to REPORT
  • Previous by thread: Re: Table column resizing overlaps the text with other column contents
  • Next by thread: Re: Help needed with setting autoresizing masks
  • Index(es):
    • Date
    • Thread