Author Topic: UILabel get current line height?  (Read 3585 times)

newwork01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
UILabel get current line height?
« on: May 24, 2016, 05:20:17 AM »
how to get current line height of the text in UILabel?  :'(

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel get current line height?
« Reply #1 on: May 24, 2016, 04:45:20 PM »
Number of lines:
  1. label.processedText.Count("\n");
Height in pixels:
  1. label.height

newwork01

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 5
    • View Profile
Re: UILabel get current line height?
« Reply #2 on: May 24, 2016, 09:13:23 PM »
i mean current height of 1 single line in UILabel, not all line of the text.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UILabel get current line height?
« Reply #3 on: May 26, 2016, 11:30:40 AM »
UILabel.fontSize for the base value, UILabel.finalFontSize for the scaled value (when the font gets shrunk via the "fit" option)