Skip to main content
Associate II
August 5, 2024
Solved

TextArea "center" alignment

  • August 5, 2024
  • 1 reply
  • 707 views

I have a TextArea that spans the full width of my screen:

farble1670_0-1722891459578.png

I've selected "center" alignment:

farble1670_1-1722891484815.png

However, when I dynamically set the text at runtime, 

 Unicode::fromUTF8(merchant_name_data, merchant_nameBuffer, MERCHANT_NAME_SIZE);
 merchant_name.resizeToCurrentText();
 merchant_name.invalidate();

It ends up left-justified:

farble1670_2-1722891671953.png

? Thanks.

 

Best answer by farble1670

My mistake, obviously I'm resizing the text area.

 merchant_name.resizeToCurrentText(); // Don't do that

1 reply

farble1670AuthorBest answer
Associate II
August 5, 2024

My mistake, obviously I'm resizing the text area.

 merchant_name.resizeToCurrentText(); // Don't do that