Android textview: text box control

Textview is a component used to display text on the interface. The displayed text cannot be edited directly by the user. Program developers can set the font size, color, style and other properties of textview. Add a textview in the main.xml of the project widgetdemo. The code is as follows:

The operation effect is shown in Figure 1.

Modify the click event of button1 as:

When button1 is clicked, we can set the style of display content by using the following different methods

As shown in Figure 2.

Of course, this process can also be implemented by modifying the main.xml file. The same effect can be obtained by modifying the textview tag according to the following code, but the process of interaction with users in the application is lost:

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>