Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
01-17-2013 07:09 AM
Is there a way to center vertically the text on a Label?
Suppose you have a label with heithg=200 and I want to center it vertically.
Is it possible?
Solved! Go to Solution.
01-17-2013 08:59 AM - edited 01-17-2013 09:00 AM
I think there is no such thing as valign or so, but if you set the label's height to the actual height of the text you can then center it vertically by applying equal top and bottom margin (if you're using layoutData) or something like
myLabel.y = (availableHeight - myLabel.height) / 2 ...
Note that you can't get the text height until the label is rendered or at least placed in the display list (otherwise it returns 0)
myLabel.validateNow(); myLabel.height = myLabel.textHeight;
My app : Get set - Get up! Get ready for the snooze revolution.
01-17-2013 12:40 PM