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:
Comments
Post a Comment