2013-11-24 110 views

回答

0

我不確定,但我認爲沒有公共API可以通過程序從應用程序訪問動態壁紙。

你最好的嘗試可能會創建自己的動畫來模擬動態壁紙:

NSArray *frames = [NSArray arrayWithObjects:[UIImage imageNamed:@"firstFrame.png"], 
         [UIImage imageNamed:@"secondFrame.png"], 
         // add other frames 
         , nil]; 
UIImageView *dynamicWallpaper = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; 
dynamicWallpaper.animationImages = frames; 
dynamicWallpaper.animationDuration = 60.0f; // seconds 
dynamicWallpaper.animationRepeatCount = 0; // 0 = loops forever 
[dynamicWallpaper startAnimating]; 
[self.view addSubview:dynamicWallpaper]; 
[dynamicWallpaper release]; 

無論如何,這樣做需要大量的圖片...