首页 > 移动平台 > 详细

Unbalanced calls to begin/end appearance transitions for **

时间:2016-02-28 12:34:17      阅读:272      评论:0      收藏:0      [点我收藏+]

在自定义UITabBarController中点击视图跳转的时候,有可能就出现这个问题, 解决方法就是在自定义的UITabBarController中的视图显示消失通知方法中添加如下方法:

- (void)viewWillAppear:(BOOL)animated

{

    [super viewWillDisappear:animated];

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

}

 

-(void)viewDidAppear:(BOOL)animated

{

    [super viewDidAppear:animated];

    [self.selectedViewController endAppearanceTransition];

}

 

-(void)viewWillDisappear:(BOOL)animated

{

    [super viewWillDisappear:animated];

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

}

 

-(void)viewDidDisappear:(BOOL)animated

{

    [super viewWillDisappear:animated];

    [self.selectedViewController endAppearanceTransition];

}

 

 

文档解释:

// If a custom container controller manually forwards its appearance callbacks, then rather than calling

// viewWillAppear:, viewDidAppear: viewWillDisappear:, or viewDidDisappear: on the children these methods

// should be used instead. This will ensure that descendent child controllers appearance methods will be

// invoked. It also enables more complex custom transitions to be implemented since the appearance callbacks are

// now tied to the final matching invocation of endAppearanceTransition.

- (void)beginAppearanceTransition:(BOOL)isAppearing animated:(BOOL)animated __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);

- (void)endAppearanceTransition __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0);

 

Unbalanced calls to begin/end appearance transitions for **

原文:http://www.cnblogs.com/iqidan/p/UITabBarController_AppearanceTransitions.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!