Zero-width line breaking space for Android

后端 未结 5 1296
庸人自扰
庸人自扰 2020-12-14 18:36

Does anyone know if \\u200b should be working on Android as a zero width space that functions as a line break if the TextView length is exceeded by the text of the TextView?

5条回答
  •  爱一瞬间的悲伤
    2020-12-14 18:50

    In your strings.xml:

    xyz987]]>
    

    In your Activity:

    TextView textView = (TextView) findViewById(R.id.myText);
    textView.setText(Html.fromHtml(getResources().getString(R.string.sample_string)));
    

    Hope it helps!

提交回复
热议问题