<pre name="code" class="objc"><p>如果双击Home,会来到iOS App的switcher页面,在这儿列出了当前系统挂起的App, 上面有每个App的切屏,相信大家都熟悉这个东东了。它其实是每个App在挂起前,</p><p>对App后个载屏。</p><p>那么我们如何自定义它在App Switcher上的展示呢,明白了它其实是对App的载屏,那么在它快进入后台的时候,我们改变其外观,那么载下来的图片,不就改变了吗?</p><p>代码如下 </p>
@interface AppDelegate ()
{
UIImageView *screenShotView;
}
@end
- (void)applicationWillResignActive:(UIApplication *)application{ if (!screenShotView) { screenShotView = [[UIImageView alloc]initWithFrame:[self.window frame]]; [screenShotView setImage:[UIImage imageNamed:@"Default-568h"]]; [self.window addSubview:screenShotView];
} screenShotView.alpha = 1;}- (void)applicationDidBecomeActive:(UIApplication *)application{ screenShotView.alpha = 0;}
时间: 2024-10-05 23:25:20