Expand TextView with wrap_content until the neighbor view reaches the end of the parent

后端 未结 7 679
遇见更好的自我
遇见更好的自我 2020-12-13 14:26

I need to achieve the following layout:

\"enter

I have two TextViews in a rela

7条回答
  •  悲&欢浪女
    2020-12-13 14:36

    The Layout you are expected can be created with help of layout_weight attirbute which comes with LinearLayout. So you may need to use LinearLayout with weightSumand layout_weight (passing to its childview) attributes.

    Here's a layout which divides your width of layout in four parts which divides in to 3:1 between both Textview. Intacting right TextView making left TextView displays text as much as possible it can show without disurbing right TextView.

    Please feel free to try out with variant weightSum and layout_weight combination as per your need.

    Layout:

    
    
        
    
        
    
    

提交回复
热议问题