ios - UITableViewCell's implementation of -layoutSubviews needs to call super -
i add together view in uitableviewcell , , utilize mas_makeconstraints (masonry)
uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:kmascellreuseidentifier forindexpath:indexpath]; uiview * view =[[uiview alloc]init]; view.backgroundcolor=[uicolor redcolor]; [cell addsubview:view]; [view mas_makeconstraints:^(masconstraintmaker *make){ make.right.equalto(cell).offset(-20); make.centery.equalto(cell); make.width.height.equalto(@20); }];
but not work.
error message: terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'auto layout still required after executing -layoutsubviews. uitableviewcell's implementation of -layoutsubviews needs phone call super.'
please help me ! @.@
better yet, why not create custom uitableviewcell
, add together views need it, via ib.
ios objective-c iphone masonry-ios-osx
No comments:
Post a Comment