• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to automatically add horizontal space between items in ListView?

 
Joan Zee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic