Forums Register Login

How to automatically add horizontal space between items in ListView?

+Pie Number of slices to send: Send


Referring to the img I posted above, everything in there are EditText that user input except "$" is a TextView and "large" is a selected spinner item. Now, I'm having difficulty to figure out how to automatically spaced "$" and the price, and also between quantity and unit (large). Here is my xml



Since I don't know how long the price that user input will be (it could be 1.80 or it could also be 9999999999.99 lol) so the solution that I can think of is to add paddingEnd and marginEnd but that leaves too much space between the items and I don't like how it looks. So, is there a way to automatically space between the two text so no matter what the price that user input, the space between $ and price; and quantity and unit will be the same? Sorry if I don't explain myself well.

Also, why does 0 at the end of the price not displayed? The price displayed two decimal points if the price, for example, 3.89. but when the price has 0 at the end (i.e. 3.80), the 0 not displayed?

Thank you.
I wasn't selected to go to mars. This tiny ad got in ahead of me:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1735 times.
Similar Threads
Unable to resume activity - NullPointerException
All controls of layout xml not shown in emulator
how to show selected values in below
how to give Edittext and button to half of the screen width?
How to get the value of textview inside tablerow in android
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:05:24.