【问题标题】:Containment and UITableView flashScrollIndicators包含和 UITableView flashScrollIndicators
【发布时间】:2013-11-25 21:34:13
【问题描述】:

我目前有一个包含子 UIViewController (Child) 的父 ViewController。子 UIViewController 有一个 UITableView。在 Child.viewDidAppear 上,我调用 TableView.flashScrollIndicators。

由于某种原因,滚动指示器没有闪烁。我注意到如果我调用 dispatch_after ,第二遍会闪现。起初我以为是尺寸问题,但我不认为是这样。这似乎是一个布局问题(我使用的是 Storybards、iOS 7,并且没有 AutoLayout)。有什么想法吗?

这是我创建孩子的代码。

- (void)viewDidLoad {
    [super viewDidLoad];

    // add it to the heirarchy
    if ([[self childViewControllers] count] == 0) {
        [self setViewControllers:[[NSMutableArray alloc] init]];

        ProductSelectionViewController *destination = (ProductSelectionViewController *)[[self storyboard] instantiateViewControllerWithIdentifier:@"ProductSelectionViewController"];

        [self addChildViewController:destination];

        // present the child
        [destination didMoveToParentViewController:self];
        [[self containerView] addSubview:[destination view]];

        [[self viewControllers] addObject:destination];

        [destination setDelegate:self];
    }
}

【问题讨论】:

    标签: ios uitableview uiviewcontroller


    【解决方案1】:

    对我来说,打电话很有效

    [self performSelector: @selector(flashScrollIndicators) withObject: nil afterDelay: 0];
    

    而不是

    [self flashScrollIndicators];
    

    在视图的didMoveToWindow 方法或其视图控制器的viewDidAppear 中。希望这可以帮助遇到同样问题的人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-29
      • 2012-08-07
      • 1970-01-01
      相关资源
      最近更新 更多