【问题标题】:notifying parent View Container通知父视图容器
【发布时间】:2014-01-17 13:46:15
【问题描述】:

我有一个 ViewContainer (UIView),当孩子消失的时候,我想告诉父级动画关闭。

是否有我可以使用的通知,以便父级侦听此通知并为关闭设置动画。

[self addChildViewController:content];                 // 1

content.view.frame = DocumentViewContainer.frame; // 2
[DocumentViewContainer addSubview:content.view];
[content didMoveToParentViewController:self];          // 3

谢谢, 尼克

【问题讨论】:

    标签: ios uiview nsnotifications uicontainerview


    【解决方案1】:
    NSDictionary *dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"NO", @"ShouldOpenNewView",  nil];
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"closeChildView" object:self userInfo:dic];
    

    【讨论】:

      猜你喜欢
      • 2013-02-04
      • 1970-01-01
      • 2017-07-03
      • 2017-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-17
      • 2017-12-27
      相关资源
      最近更新 更多