Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xcode 11.3 UITableView:Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy #129

Open
include11 opened this issue Jan 16, 2020 · 2 comments

Comments

@include11
Copy link

VTMagic[6333:1035842] [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.g. table view bounds, trait collection, layout margins, safe area insets, etc), and will also cause unnecessary performance overhead due to extra layout passes. Make a symbolic breakpoint at UITableViewAlertForLayoutOutsideViewHierarchy to catch this in the debugger and see what caused this to occur, so you can avoid this action altogether if possible, or defer it until the table view has been added to a window. Table view: <UITableView: 0x1060be200; frame = (0 0; 375 603); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x282a10f30>; layer = <CALayer: 0x2824449c0>; contentOffset: {0, 0}; contentSize: {375, 2200}; adjustedContentInset: {0, 0, 49, 0}; dataSource: <_UIFilteredDataSource: 0x282a17e40>>

@YNBand
Copy link

YNBand commented Jun 22, 2020

我也遇到这个问题了

@kevintianyao
Copy link

我也遇到这个问题了,看了代码,在VTMagicView里修改了下,可以解决这个问题,具体修改如下:
reloadDataWithDisIndex 这个方法中
//[self setNeedsLayout];
// [self layoutIfNeeded];
把这个手动去调用layoutsubViews的方法给干掉就不会出现上述的报错了。因为目前应该也不用去多次手动去触发layoutsubViews方法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants