OK, not a good subject line, but I couldn't come up with anything more descriptive. I hope I can explain the issue clear enough...I'm a fair Core Animation newbie... (I know this is long, sorry, but if nothing else, watch the video linked at the end, and see if that rings any bells.)

I have integrated the Lemur Flip code (<http://tinyurl.com/ 4ftovo>*)into my Mac program, to simulate the same sort of view flipping as seen on the iPhone. (See, for example, the Stocks app on the iPhone, when you press the (i) button at the bottom left, and then the Done button.)

I reworked it such that it uses my existing views, not using an overlay window like the Lemur Flip code uses. It's working pretty darn good, kudos to Mike Lee for this. Doesn't look quite as good as the animation on the iPhone, but it's still nice.

Anyway, the issue crops up *after* this animation finishes. Here's my set up:

The 2 views I'm flipping reside in the same parent view (obviously); one view is smaller (maybe 200pix wide by 300 pixels high), the other takes up almost the entire area of the parent view (about 400x500). Also in that parent view is a button that I use to initiate the flip. This button is at the very top of the view hierarchy, drawn on top of everything. However, when the animation flips from the small view to the larger view, the button is no longer drawn. I can still click on where it's supposed to be and it works, it's just not drawn.

The weird thing is, the button is visible all the time *during* the animation (as the animation is being rendered behind the button); it's only after the animation completes that it disappears. The - animationDidStop:finished: delegate method that gets called at the end doesn't appear like is should have any affect on my button; in fact, I did not change that code *at*all* from the Lemur Flip sample code.

I can enlarge the window, and since the button is bound to the corner of the window, and the animated views are of a fixed size, I can see the button slide out from underneath the large view, even though I can click on it *through* the view!

If I take out the section

// Although the "back" layer seemed to rotate forward, in reality it's still flipped.
[CATransaction begin];
// Since this is already our assumed state, do not animate this
[CATransaction setValue:[NSNumber numberWithBool:YES] forKey:kCATransactionDisableActions];
// Remove all transforms by setting the identity (standard) transform
frontView.layer.transform = CATransform3DIdentity;
backView.layer.transform = CATransform3DIdentity;
[CATransaction commit];

then the button stays drawn on top of everything, as it should, but then, of course, the view is drawn backwards (as indicated by the comments in the code)!

Can anyone set me straight on why my button is getting buried beneath a view after the animation, yet is still clickable? Here's a video screen capture I took of it behaving like this: <http://www.not-pc.com/CoreAnimationGlitch.mov >.

Thanks a bunch!
randy


*-Sorry for the use of a TinyURL there, but there's profanity in the URL, and I'd like to hit as many folks as possible with this posting without it getting delayed or bounced or whatever because of that.
_______________________________________________

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