• 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: Wed, 25 Nov 2009 18:49:57 -0500

Never mind,

I figured it out.

Regards,

	UIImage *image = [UIImage imageNamed:@"top.png"];
	UIImageView *imageView = [ [ UIImageView alloc ]  initWithFrame:CGRectMake(295, 480/2, image.size.width, image.size.height) ];
	imageView.image = image;
	imageView.transform = CGAffineTransformMakeRotation(M_PI/2.0);



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



On Nov 25, 2009, at 6:36 PM, Philip Vallone wrote:

> Hi,
>
> I have a UIImageView that overlays a MPMoviePLayerController. When the movie plays, the view is in landscape. I want to have my overlay image to drop from the top of the movie and move down. The below code rotates the image. How do I get this effect?
>
>
> - (void)showOverlay:(NSTimer *)timer {
>
> 	NSArray *windows = [[UIApplication sharedApplication] windows];
>
> 	UIImage *image = [UIImage imageNamed:@"top.png"];
> 	UIImageView *imageView = [ [ UIImageView alloc ]  initWithFrame:CGRectMake(0.0, 0.0, image.size.width, image.size.height) ];
> 	imageView.image = image;
> 	imageView.transform = CGAffineTransformMakeRotation(M_PI/2.0);
>
>
>
> 	CGFloat moveDistance = -50.0;
> 	CGContextRef context = UIGraphicsGetCurrentContext();
> 	[UIView beginAnimations:@"moveImageDown" context:context];
> 	[UIView setAnimationDuration:1.0];
> 	CGAffineTransform transform = CGAffineTransformMakeTranslation(0, moveDistance);
> 	[imageView setCenter:CGPointMake(295, 480 / 2  )];
> 	imageView.transform = transform;
> 	[UIView commitAnimations];
>
>
>
> 	mpw = [windows objectAtIndex:1];
> 	[mpw addSubview:imageView];
>
> }
>
> Thanks
>
> Phil
>
>
> _______________________________________________
>
> 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

_______________________________________________

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>)

  • Prev by Date: NSOutlineView - how to have a default item selected
  • Next by Date: Re: NSOutlineView - how to have a default item selected
  • Previous by thread: UIImageView Animation Question
  • Next by thread: Re: UIImageView Animation Question
  • Index(es):
    • Date
    • Thread