【问题标题】:Use dynamic wallpaper as app background使用动态壁纸作为应用背景
【发布时间】:2013-11-24 09:49:50
【问题描述】:

是否可以预设一张提供的动态壁纸用作我的应用程序的背景?它不一定是用户目前正在使用的 API,因为我知道没有公共 API,但我在编码时选择的任何人都可以。

【问题讨论】:

    标签: iphone dynamic background ios7 wallpaper


    【解决方案1】:

    我不确定,但我认为没有公共 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];
    

    无论如何,这样做你需要很多图像...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多