Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 03-14-2010, 07:47 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 2
Default Get UIView's alpha value during an animation

Hi, I'm animating an UIImageView (transforms and alpha) and need to be able to pause / resume the animation. Got the tranforms working fine but I've not managed to grab the changing alpha value. Grabbing the UIImageView's alpha (myView.alpha) directly just gives me the before or after value [1.0, 0.0]. For mid-animation transforms I'm accessing the layer's presentation layer to get to its transform ... thought there might be something similar for the changing alpha value but haven't found anything yet.
Any ideas?
Thanks for any help.

Last edited by tallyho; 03-15-2010 at 07:41 AM.
tallyho is offline   Reply With Quote
Old 03-15-2010, 08:38 AM   #2 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 2
Default sorted ...

I missed the presentation layer's opacity property ... that holds the current animated alpha value.

Cheers
tallyho is offline   Reply With Quote
Old 03-17-2010, 09:14 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 4,814
Default Can you post some sample code?

Quote:
Originally Posted by tallyho View Post
I missed the presentation layer's opacity property ... that holds the current animated alpha value.

Cheers
I've never tried to read the "in flight" value of a view with an animation in progress. Can you post some sample code showing how to get those values?

Can you query the presentation layer while the animation is active?

If you could grab the transform for a rotate/translate/scale, it might even be possible to do hit testing of touches on a view that's mid-animation, which is something I didn't think was practical (For a crude hit test I would get the transform for the view, then apply that transform to the view's frame.)


Regards,

Duncan C
WareTo
Duncan C is offline   Reply With Quote
Old 03-18-2010, 05:15 AM   #4 (permalink)
Mobile and Web solutions
 
hello24's Avatar
 
Join Date: May 2009
Location: London, UK
Posts: 72
Send a message via Skype™ to hello24
Default

If I remember correctly from one of the Stanford lectures, you don't have access to the intermediate values and you can't change a transition whilst it's running.
From the developer point of view, the view has only 2 states and the final state comes into effect when you commit the animations.
hello24 is offline   Reply With Quote
Old 09-11-2010, 04:28 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2010
Age: 16
Posts: 9
Default

Quote:
Originally Posted by tallyho View Post
Hi, I'm animating an UIImageView (transforms and alpha) and need to be able to pause / resume the animation. Got the tranforms working fine but I've not managed to grab the changing alpha value. Grabbing the UIImageView's alpha (myView.alpha) directly just gives me the before or after value [1.0, 0.0]. For mid-animation transforms I'm accessing the layer's presentation layer to get to its transform ... thought there might be something similar for the changing alpha value but haven't found anything yet.
Any ideas?
Thanks for any help.
I am just thinking at the top of my head, so im not sure if it will work.
Try using an NSTimer for your animation and everytime your timer fires it will do an NSLog of the alpha.
nesh96 is offline   Reply With Quote
Reply

Bookmarks

Tags
alpha, animation, calayer, uiview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 274
21 members and 253 guests
ADY, Bertrand21, Dani77, fkmtc, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, MACralik, mer10, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84, Sunny46
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:02 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0