alignmentlabelaxure

Center label after dynamic text update in Axure


I've got a label we'll call selectedTextLabel with multiple labels underneath it forming a list (yes, I know about repeaters), when I select one of the lower labels I throw in that label's text description into selectTextLabel. The problem I've running into is that, though selectedTextLabel is aligned center (positionally) and the text within it is center aligned, when new text that is longer or shorter than the original gets put within it from an action, it keeps the same top left xy coordinants and increases or decreases the width accordingly making my design look misaligned.

It's almost like it's not obeying text-align: center on dynamic text like it does in the editor.

Does anyone know a solution? Is this a bug? I've googled but only have gotten editor based answers as opposed to dynamic browser based answers.

Thanks.


Solution

  • After an insight, it turns out it's rather easy. You just have to make the label the full width that you want it to be centered within. Then if you have text align center set, it'll keep the text centered.

    What was happening in my instance was that I only had the label set to the width of the first selection and since the label didn't know what to do when something longer was set as the text, it expanded it's width but kept the same top left x and y coordinants, making the new center misaligned.

    I hope this helps someone out there.