views:

39

answers:

2

I want to use the image in view which will move like marquee as in HTML,from one end to another end of view. Could anyone provide me with that code how to do that.

Thanks in advance n please help me out with this.

A: 

Use uiview's transition effects..

[UIView AnimateWithDuration: delay: options: animations: completion: ];

methode. repeat transition with some nice effects.

Aji
thanks buddy i will use this method...
sabby
[UIView AnimateWithDuration:3 delay:1 options:nil animations:@"logo(1).png",@"sabby.png" completion:YES ]; I tried like this but its showing warning message.could you let me know where is the mistake.
sabby
+1  A: 

It was the new Blocks API which introduced in iOs 4.0 Use this if you are not yet in 4.0

 CABasicAnimation *theAnimation;        
theAnimation=[CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
theAnimation.duration=1;
theAnimation.repeatCount=2;
theAnimation.autoreverses=YES;
theAnimation.fromValue=[NSNumber numberWithFloat:0];
theAnimation.toValue=[NSNumber numberWithFloat:-60];
[view.layer addAnimation:theAnimation forKey:@"animateLayer"];

This bit of code moves the view 60 pixels to the left then back to its original position [please dont forget to vote if you find this answer useful :-) ]

Aji
Yes bro that was the reason i am usin iphone 3.2.1 sdk,so getting the problem.I will try it tommorow.Sure i will vote fore you but i need 15 reputations,i had 11 but somebody voted me down.
sabby