• 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: UIImageView Animation Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UIImageView Animation Question


  • Subject: Re: UIImageView Animation Question
  • From: Philip Vallone <email@hidden>
  • Date: Thu, 26 Nov 2009 14:31:19 -0500

Hi David,

Thanks for the reply. When I remove the reference to UIGraphicsGetCurrentContext() my Image doesn't drop in.


Removed:

CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:@"moveImageDown" context:context];


The following code works:

	imageView = [ [ UIImageView alloc ]  initWithFrame:CGRectMake(295, 480/2, image.size.width, image.size.height) ];
	imageView.image = image;
	imageView.transform = CGAffineTransformMakeRotation(M_PI/2.0);

	imageBottomView = [ [ UIImageView alloc ]  initWithFrame:CGRectMake(-220, 207, imageBottom.size.width, imageBottom.size.height) ];
	imageBottomView.image = imageBottom;
	imageBottomView.transform = CGAffineTransformMakeRotation(M_PI/2.0);


	pos = 295;

	CGContextRef context = UIGraphicsGetCurrentContext();
	[UIView beginAnimations:@"moveImageDown" context:context];
	[UIView setAnimationDuration:2.0];
	[imageView setCenter:CGPointMake(pos, 480 / 2  )];
	[UIView commitAnimations];
	[mpw addSubview:imageView];


Thoughts?

On Nov 26, 2009, at 1:13 PM, David Duncan wrote:

> On Nov 25, 2009, at 3:49 PM, Philip Vallone wrote:
>
>> 	CGContextRef context = UIGraphicsGetCurrentContext();
>> 	[UIView beginAnimations:@"moveImageDown" context:context];
>> 	[UIView setAnimationDuration:1.0];
>> 	[imageView setCenter:CGPointMake(295, 480 / 2  )];
>> 	[UIView commitAnimations];
>
>
> Keep in mind that the call to UIGraphicsGetCurrentContext() here is superfluous, and likely returning NULL. You can remove it without making any change on the behavior of your code.
> --
> David Duncan
> Apple DTS Animation and Printing
>

_______________________________________________

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: UIImageView Animation Question
      • From: David Duncan <email@hidden>
References: 
 >UIImageView Animation Question (From: Philip Vallone <email@hidden>)
 >Re: UIImageView Animation Question (From: Philip Vallone <email@hidden>)
 >Re: UIImageView Animation Question (From: David Duncan <email@hidden>)

  • Prev by Date: show selected image in a segmented control
  • Next by Date: Re: show selected image in a segmented control
  • Previous by thread: Re: UIImageView Animation Question
  • Next by thread: Re: UIImageView Animation Question
  • Index(es):
    • Date
    • Thread