Android removes the gap between two textviews

Source: Internet
Author: User

Android removes the gap between two textviews

Two textviews are adjacent to each other, but the text is dynamically generated, that is, the number of words is changing, so the text is not displayed together. Two textviews are set separately, however, the requirement is that the two must be put together and placed next to each other. Therefore, we have to eliminate the gaps between them. The online method is as follows:

Android: layout_marginLeft =-10px can eliminate the default gaps between the two controls !!!!

 

My example is as follows:

 

Android: layout_width = fill_parent
Android: layout_height = wrap_content
Android: layout_weight = 1
Android: orientation = horizontal>


Android: id = @ + id/orderhis_type
Android: layout_width = wrap_content
Android: layout_height = wrap_content
Android: textColor = # fffffdfd
Android: textSize = 20dp/>


Android: id = @ + id/orderhis_price
Android: layout_width = match_parent
Android: layout_height = wrap_content
Android: layout_marginLeft =-10px
Android: textColor = # fffffdfd
Android: textSize = 20dp
Android: textStyle = bold/>
 

The red part is the focus. I hope to record it and it will be useful to some people.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.