gif图像作为背景

时间:2010-07-06 04:45:40

标签: iphone

我们可以使用gif图像作为背景吗? 我想将gif图像设置为背景,就像一些鸟儿飞翔......

我们可以使用gif图像设置为背景。???

如果是,那么?

感谢和问候

2 个答案:

答案 0 :(得分:1)

是的,你可以 - 我想你想要一个GIF动画?

它与静态背景的CSS规则相同。

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

答案 1 :(得分:0)

在这里,我得到了解决方案。

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];