Android development study notes (15) text label TextView

Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
Control the color of the TextView through JAVA: (take the initialized Empty as an example)

First add the id in the TextView: android:id="@+id/text_view" and
then in the Java program: find the id: TextView text = findViewById(R.id.text_view);
set the color after getting the text variable: text.setTextColor (Color.BLUE);
Note: All letters of the color (BLUE) are capitalized

effect:
Insert picture description here

Guess you like

Origin blog.csdn.net/qq1198768105/article/details/113835832