如何更改 TextView 的大小和颜色?

How to change the size and colour of a TextView?

在制作我的第一个 android 应用程序时,我在使用 Java 代码更改 TextView 的大小和颜色时遇到了一些问题。

更改文字颜色

textView.setTextColor(ContextCompat.getColor(context, R.color.<name_of_color>));

更改文字大小

text.setTextSize(TypedValue.COMPLEX_UNIT_SP,14);