thieumao

Tính height Label

Feb 10th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. let width = isPortrait ? CommonUtility.getPortraitScreenSize().width - 40 : CommonUtility.getLandscapeScreenSize().width - 40
  2. let apply = LocalizationHelper.shared.localized("RECRUITMENT_COMPANY_NOTE")
  3. let textAttributes = [
  4. NSFontAttributeName: UIFont(name: CommonDefine.fontRegularName, size: 14) as Any
  5. ]
  6. let applyBounding = apply.boundingRect(with: CGSize(width: width, height: CGFloat.greatestFiniteMagnitude), options: .usesLineFragmentOrigin, attributes:textAttributes , context: nil)
  7. print(applyBounding)
  8. print(applyBounding.height)
Advertisement
Add Comment
Please, Sign In to add comment