swift - Automatic Label Resize in UICollectionViewCell Not Working -


i having trouble getting label in uicollectionviewcell dynamically resize based on length of string. have subclassed cell , linked label it. have set number of lines 0 , still not dice.

i call sizetofit() method.

compiling ios 8.2

here custom cell code:

class itemcollectioncell: uicollectionviewcell {  @iboutlet weak var titlelabel: uilabel! @iboutlet weak var reviewerlabel: uilabel! @iboutlet weak var statusimageview: uiimageview!  override func awakefromnib() {     super.awakefromnib()     self.selected = false      titlelabel.numberoflines = 0     titlelabel.sizetofit()     } } 

make sure didn't uncheck autoresize subviews in interfacebuilder:

enter image description here


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -