I’ve had a good search for this on here and can’t find a solution.
I have a TextView in a RelativeLayout which contains an integer number.
The number will range between 1 and 99 – can anyone tell me how to size
the TextView so that its width is always the width of the string “99”
even if it only contains “1”?
I need this because the positions of the components to the right of this
TextView depend on its width, so all are position depending on how many
digits the TextView contains.
I don’t mind if this is done in XML or code – I just want to avoid having
to set the width of a TextView in pixels!
Thanks for any possible solutions; Please ask if I’ve missed out any
important info!
try this: