objective c - Unable to set top margin NSLayout Constraint programatically in iOS? -


i trying set top margin constraint not work.i have custom cell in have 2 labels.i want give top spacing dynamic @ run time between labels have set constraint of top margin & have made outlet of & using below code update top margin.

 self.view.translatesautoresizingmaskintoconstraints = no;             self.customcell.nslc_first_comment_margin.constant=-21;             [self.customcell.first_comment layoutifneeded]; 

please tell how solve problem?

edit: code works if write code inside cellforrowatindexpath not work under heightforrowatindexpath?can please tell exact reason behaviour.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -