android lineheight text code example

Example 1: selectable text flutter

//This is a widget
SelectableText("Your text here")
//You can know select the text

Example 2: android studio centering textview in relativelayout

android:layout_centerHorizontal="true"

Example 3: set html text android java

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
    textView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>", Html.FROM_HTML_MODE_COMPACT));
} else { 
    textView.setText(Html.fromHtml("<h2>Title</h2><br><p>Description here</p>"));
}

Tags: