dimanche 30 novembre 2014

Resizing the height of UILabel to fit text

I have UILabel in my Cell Subclass which is suppose to hold a title. The size of the title can be various lengths and therefor i need to resize the UILabel to fit the text and to prevent that the text is not to long i also need to be able to set maxHeight. The width should be the same. How can i create such code in swift in a tableViewCell subclass.


so far i have this in awakeFromNib



theTitleLabel?.font = UIFont(name: "HelveticaNeue", size: 13)
theTitleLabel?.textColor = UIColor(rgba: "#4F4E4F")
theTitleLabel?.numberOfLines = 0
theTitleLabel?.lineBreakMode = NSLineBreakMode.ByTruncatingTail



Aucun commentaire:

Enregistrer un commentaire