1 Reply Latest reply on Dec 8, 2008 10:07 AM by rtalton

    Vertially align text in a button?

    Zen Seven Level 1
      I've looked through the source code and there doesn't seem to be an obvious way of doing it. Strange that there's a horizontal align, but no vertical style. Anyone has been able to successfully do this? Or do I have to add my own UITextField?
        • 1. Re: Vertially align text in a button?
          rtalton Level 4
          You could do a custom component to accomplish this.
          But here's a function that will work. It uses the setStyle method and sets the bottom and top padding for the text. Using setStyle may not be the most efficient way, though, as it causes Flex to do more layouts.
          Call this function on the button's creationComplete event:
          creationComplete="setButtonPadding(event,'bottom')"
          ...using the values 'top' or 'bottom' to set the text.

          FYI:
          If you use an icon on the button, you can then use the labelPlacement property to set the text to bottom or top.