CodePudding user response:
Use the maxWidth, set the maximum widthCodePudding user response:
Can set layout_weigth ahCodePudding user response:
Android: layout_width="match_parent"
Android: layout_height="wrap_content" & gt;Android: text="text"
Android: layout_width="0 dp"
Android: layout_height="wrap_content"
Android: layout_weight="1"/& gt;Android: text="text"
Android: layout_width="wrap_content"
Android: layout_height="wrap_content"/& gt;
CodePudding user response:
Set up the first TextView weight layout_weight="1", the width of the layout_width="0 dp", you can put the weights as a relative percentage, father takes up the percentage of residual control layout, if you want two TextView, each accounted for 50% of the parent layout, the weight of the second TextView layout_weight="1", the width of the layout_width="0 dp", can, you will be more,