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 (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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to