cancel
Showing results for 
Search instead for 
Did you mean: 

box resize but fill colour does not change

Eddie1066
Associate

I'm using a coloured box as a background for some dynamic text. I would like the background to match the width of the text when it changes.
I can change the width of the box to match the text width, but the box's fill colour will not fill to match the new box width.

This is the code I'm using.

memset(&textValueBuffer, 0, sizeof(textValueBuffer));
Unicode::fromUTF8((const uint8_t*)it->second.data(), textValueBuffer, it->second.length());
textValue.resizeToCurrentText();
textValue.invalidate();

box1.setWidth(textValue.getWidth());
box1.invalidate();

 Is this possible in TouchGFX?

0 REPLIES 0