Android TextView Text not getting wrapped

前端 未结 24 1712
时光说笑
时光说笑 2020-11-27 02:51

Can anyone tell me what\'s going wrong with the text? Text longer than one line doesn\'t wrap to the next line but goes beyond the screen.

Following is the code:

24条回答
  •  时光说笑
    2020-11-27 03:36

    I'm using constraint layout mostly.

    1) android:layout_width="match_parent" = tries to stretch to meet edges

    2) android:layout_width="wrap_content" = based solely on the input text without regard for other views nearby. for example adding android:textAlignment="center" will change the shape of the text

    3) android:padding="12dp" android:layout_width="0dp" android:layout_weight="1" android:singleLine="false"

    = The text will fold to accommodate nearby layouts without regard to the text itself

提交回复
热议问题