How do you determine the line height (in pixels) of the text in a Spark Label?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
keyle’s answer will only give you the height of the text, not the actual ‘lineHeight’ style. You can easily get that style like this:
The problem is that this can return a relative value (a percentage) or an absolute value (in pixels). The default – if no lineHeight was explicitely set – is
"120%".So here’s how we can get the value in pixels in both cases: