cancel
Showing results for 
Search instead for 
Did you mean: 

Result with unit display

KNara.2
Associate III

Hi,

I'm in the process of implementing a result screen which displays the result along with unit.

Since the digits are not the same I see a spacing issue between result and result unit.

Example : 11 cm , 22cm

and 99 cm

I cannot have a fixed x and y co ordinate for the result unit.

This is because when eleven is displayed the result shrinks and looks far away from the result unit.when its 22 the result almost touches the result unit.

Is there a way to move the result unit (wild card position) along with the result (wild card) x and y co ordinates.

So that the spacing between result and result unit remains the same for all digits?

 

1 ACCEPTED SOLUTION

Accepted Solutions
JTP1
Lead

Hi

You can use getWidth- function to get width of result and then setX or moveTo command to move unit text.

Like this:

 

unitText.moveTo(valueText.getX()+valueText.getWidth()+4,valueText.getY());

 

Br J.T

View solution in original post

1 REPLY 1
JTP1
Lead

Hi

You can use getWidth- function to get width of result and then setX or moveTo command to move unit text.

Like this:

 

unitText.moveTo(valueText.getX()+valueText.getWidth()+4,valueText.getY());

 

Br J.T