2012-12-05 23 views
3

我可以通過更改舊ios版本中的單元格框架來滑動TableView單元格的contentView。但是,我無法在Autolayout中滑動它。就我而言,我創建一個自定義的表格單元格,如下圖:如何在Autolay中滑動tableview單元格?

enter image description here

我已經滑動電池沒有帶走所有領導和主要約束,但仍there'are一定限制,以防止滑動我的細胞如

"<NSAutoresizingMaskLayoutConstraint:0x8a39c60 h=--& v=--& UITableViewCellContentView:0x8a2f640.midX == + 160>", 
"<NSAutoresizingMaskLayoutConstraint:0x8a39ca0 h=--& v=--& H:[UITableViewCellContentView:0x8a2f640(320)]>", 
"<NSAutoresizingMaskLayoutConstraint:0x8a39ce0 h=--& v=--& UITableViewCellContentView:0x8a2f640.midY == + 21.5>", 
"<NSAutoresizingMaskLayoutConstraint:0x8a39d20 h=--& v=--& V:[UITableViewCellContentView:0x8a2f640(43)]>" 

但是,如果我用

[self setTranslatesAutoresizingMaskIntoConstraints:NO]; 
在我的自定義單元格

,有一個問題:

 
*** Assertion failure in -[UITableView layoutSublayersOfLayer:], /SourceCache/UIKit_Sim/UIKit-2372/UIView.m:5776 
2012-12-05 22:45:14.987 Slider[3773:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Auto Layout still required after executing -layoutSubviews. UITableView's implementation of -layoutSubviews needs to call super.' 

我不知道如何解決它,請幫助我。

回答

相關問題