didMoveToSuperview

转载自:http://www.cnblogs.com/jay-dong/archive/2012/06/13/2547489.html

代码:

- (void)didMoveToSuperview

{

    if (!_navigationBar)

    {

        self.navigationBar = (UINavigationBar *)self.superview;

    }

}


  1. //当加入视图完成后调用  
  2. (void)didAddSubview:(UIView *)subview  
  3. //当视图移动完成后调用  
  4. (void)didMoveToSuperview  
  5. //当视图移动到新的WINDOW后调用  
  6. (void)didMoveToWindow  
  7. //在删除视图之后调用  
  8. (void)willRemoveSubview:(UIView *)subview  
  9. //当移动视图之前调用  
  10. (void)didMoveToSuperview:(UIView *)subview  
  11. //当视图移动到WINDOW之前调用  
  12. (void)didMoveToWindow 

你可能感兴趣的:(didMoveToSuperview)