2010-07-06 148 views
1

我們可以使用gif圖像作爲背景嗎? 我想設置一個gif圖像作爲背景,就像一些飛翔的鳥兒一樣......gif圖像作爲背景

我們可以用gif圖像來設置背景嗎?

如果是,比如何?

感謝和問候

+0

這看起來不像一個編程問題。 – 2010-07-06 04:48:25

+0

@marcelo 所以,笏你以爲是。 c我的回答...... – iscavengers 2010-07-06 05:01:24

+0

看起來有人想把一些壁紙加載到他們的iPhone上。另一個答案假設完全不同的情況,並且得到了投票(不是我)的事實表明,混淆不是我一個人。 – 2010-07-06 05:11:09

回答

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

是的你可以 - 我假設你想要一個動畫GIF?

它和靜態背景是一樣的CSS規則。

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