我想看看哪些視圖在屏幕上呈現在我的應用程序中。因此,我使用iOS模擬器的「屏幕外渲染」功能,它可以通過黃顏色給那些離屏渲染的視圖着色。但是,在應用程序啓動後,整個屏幕被黃色着色,我不相信它。iOS模擬器的「顏色偏屏渲染」功能有什麼問題嗎?
然後我盡我的測試代碼,如:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.window.backgroundColor = [UIColor whiteColor];
self.window.rootViewController = [[UITabBarController alloc] init];
// self.window.rootViewController = [[UINavigationController alloc] init];
// self.window.rootViewController = [[UIViewController alloc] init];
[self.window makeKeyWindow];
}
正如你可以在上面看到,我只是設置窗口的RootViewController的三次不同的原單控制器:「的UITabBarController」,「UINavigationController的」和「的UIViewController」。
猜猜是什麼?
只有'UIViewController'不是全屏色!
所以任何人都知道爲什麼原單RootViewController的和的UINavigationController將出現整個屏幕屏幕外渲染??????