對(duì)于 UITabarController管理的導(dǎo)航控制器的根界面,如果加入動(dòng)畫(huà)炬称,你會(huì)發(fā)現(xiàn)汁果,當(dāng)應(yīng)用退出到后臺(tái),然后進(jìn)入到前臺(tái)玲躯,你就會(huì)發(fā)現(xiàn)動(dòng)畫(huà)停止了据德。解決辦法就是添加通知監(jiān)聽(tīng)?wèi)?yīng)用進(jìn)入前臺(tái),進(jìn)入活躍狀態(tài)跷车。
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidEnterPlayground) name:UIApplicationDidBecomeActiveNotification object:nil];
}
-(void)appDidEnterPlayground{
[self.heroBtn.layer removeAllAnimations];
[self.heroBtn.layer addAnimation:[self groupAnimation] forKey:nil];
}