1 #import "TXAppDelegate.h" 2 3 @implementation TXAppDelegate 4 5 /** 6 * app加载完毕的时候调用(一般只调用一次) 7 * 8 */ 9 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 10 { 11 NSLog(@"didFinishLaunchingWithOptions"); 12 return YES; 13 } 14 15 /** 16 * app失去焦点的时候调用(UI控件不能正常使用) 17 */ 18 - (void)applicationWillResignActive:(UIApplication *)application 19 { 20 NSLog(@"applicationWillResignActive"); 21 } 22 23 /** 24 * app进入后台的时候调用(app消失不见) 25 */ 26 - (void)applicationDidEnterBackground:(UIApplication *)application 27 { 28 NSLog(@"applicationDidEnterBackground"); 29 } 30 31 /** 32 * app进入前台的时候调用(app显示出来) 33 */ 34 - (void)applicationWillEnterForeground:(UIApplication *)application 35 { 36 NSLog(@"applicationWillEnterForeground"); 37 } 38 39 /** 40 * 当app获得焦点的时候调用(这时候整个app的UI控件都能正常使用) 41 */ 42 - (void)applicationDidBecomeActive:(UIApplication *)application 43 { 44 // UITabBarController *tabbarVc = (UITabBarController *)self.window.rootViewController; 45 // NSLog(@"%@", NSStringFromCGRect(tabbarVc.tabBar.frame)); 46 47 // for (UIView *child in tabbarVc.tabBar.subviews) { 48 // if ([child isKindOfClass:[UIImageView class]]) { 49 // [child removeFromSuperview]; 50 // } 51 // } 52 NSLog(@"applicationDidBecomeActive"); 53 } 54 55 //app进入后台:休眠, 不能接受事情(比如关闭) 56 /** 57 * app关闭的时候调用(一般情况下不会调用) 58 */ 59 - (void)applicationWillTerminate:(UIApplication *)application 60 { 61 NSLog(@"applicationWillTerminate"); 62 } 63 64 @end