Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

As for the TextView, programmatically change the style?

For example:

TextView textView = new TextView(PhotoActivity.this);
textView.setText("Photo not found.");

How to set the style?

textView.set... ???
like image 915
RAPOS Avatar asked Nov 28 '22 04:11

RAPOS


1 Answers

For styling TextView programmatically you must have a style inheriting a TextAppearance style, and you can apply it using the following:

TextViewCompat.setTextAppearance(statusLinkTextView, R.style.YourTextAppearanceStyle);
like image 79
Jorge Castillo Avatar answered Dec 04 '22 21:12

Jorge Castillo