tags:

views:

51

answers:

2

Hi all,

can we use a gif image as a background? i want to set an gif image as a background, like some birds flying ....

can we use gif image to set as background.???

if yes than how?

thanks and regards

+1  A: 

Yes you can - I assume you want an animated gif?

It's the same CSS rule as a static background.

body {
    background: url(animated.gif);
}
Marko
A: 

Here, i got the solution.

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds]; animatedImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"default1.jpg"], [UIImage imageNamed:@"default2.jpg"], [UIImage imageNamed:@"default3.jpg"], [UIImage imageNamed:@"default4.jpg"], [UIImage imageNamed:@"default5.jpg"], [UIImage imageNamed:@"default6.jpg"], [UIImage imageNamed:@"default7.jpg"], [UIImage imageNamed:@"default8.jpg"], [UIImage imageNamed:@"default9.jpg"], [UIImage imageNamed:@"default10.jpg"],
[UIImage imageNamed:@"default11.jpg"], [UIImage imageNamed:@"default12.jpg"], [UIImage imageNamed:@"default13.jpg"], [UIImage imageNamed:@"default14.jpg"],
[UIImage imageNamed:@"default15.jpg"], nil]; animatedImageView.animationDuration = 3.0f; animatedImageView.animationRepeatCount = 0; [animatedImageView startAnimating]; [self.view addSubview: animatedImageView];

shishir.bobby