首页 > 代码库 > 自定义tabBarcontroller必须实现以下几个方法

自定义tabBarcontroller必须实现以下几个方法


-(void)viewDidAppear:(BOOL)animated

{

    [self.selectedViewController endAppearanceTransition];

}

-(void)viewWillAppear:(BOOL)animated

{

    [self.selectedViewController beginAppearanceTransition: YES animated: animated];

}


-(void) viewWillDisappear:(BOOL)animated

{

    [self.selectedViewController beginAppearanceTransition: NO animated: animated];

}

-(void) viewDidDisappear:(BOOL)animated

{

    [self.selectedViewController endAppearanceTransition];

}




这个在自定义tabBarcontroller的类里面写


报错:Unbalanced calls to begin/end appearance transitions for XXXX

报这样的警告,是因为:过于快速切换子视图控制器,导致,前一个切换动作还没有完成,就进行了下一个切换!



自定义tabBarcontroller必须实现以下几个方法