1. 程式人生 > >ios -- app從後臺進入前臺,上下有黑邊

ios -- app從後臺進入前臺,上下有黑邊

這個問題糾結了好久,才發現在AppDelegate.m裡沒有設定window的背景顏色。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];

    self.window.backgroundColor = [UIColor whiteColor]; // 這句話


    [self.window makeKeyAndVisible];

    return YES;
}