2013-01-06 47 views
4

我越來越:AutoLayout打開時,如何解決AssertionFail?

Assertion failure in -[Cell layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView.m:5776 
2013-01-06 14:58:42.951 Likely[4588:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. Cell's implementation of -layoutSubviews needs to call super.' 

我寫道:

-(void)layoutSubviews{ 
    [super layoutSubviews]; 
} 

在Cell.m文件。但不起作用。我能做什麼?

+0

可能相同的症狀http://stackoverflow.com/questions/12610783/auto-layout-still-required-after-executing-layoutsubviews-with-uitableviewcel – vokilam

回答

0

你可以嘗試在超級調用之後添加。

[self layoutIfNeeded]; 

這會導致給:

- (void)layoutSubviews 
{ 
    [super layoutSubviews]; 
    [self layoutIfNeeded]; 
} 
相關問題