是否可以预置一张动态壁纸,作为我的应用程序的背景?它不一定是用户目前正在使用的,因为我知道这方面没有公共API,但是我在编写代码时选择的任何人都可以。
发布于 2013-11-24 10:21:36
我不确定,但我认为没有公共app可以从应用程序中以编程方式访问动态壁纸。
您最好的尝试是通过创建自己的动画来模仿动态壁纸:
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];总之,这样你就需要很多图像.
https://stackoverflow.com/questions/20173194
复制相似问题