This is really annoying me, but if I do
<mx:CheckBox label="Checkbox" />
the label is slightly off the vertical center. I haven’t found anything that relates to vertical alignment of the label in checkbox. How can I fix this?
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.
You’ll want to adjust the leading of your font, so in your label style, you’ll want to have something like:
Note that 0 may not be the correct value for your font, it may be 1 or even -2 on some fancy fonts.
Basically your issue is that the height of the text in your check box is calculated to include the leading (spacing between lines of text), whose default value is 2. Since Checkboxes generally don’t have two lines of text, you can set this value to 0, and it’ll draw your check box correctly. You can also specify leading in the mxml tag or via
setStylebut as leading is a style, the best place to set it is in the css.