Android EditText: edit box control
•
Android
EditText is a subclass of textview. It adds text editing function on the basis of textview. It is used to process user input, such as login box. It is a very common component. Add an EditText in the main.xml file of the project widgetdemo and realize this function: when users input information in EditText, a textview is used to display the information entered by users. The code added in the layout file main.xml in the project widgetdemo is as follows:
Add the following code to the oncreate() method of widgetdemoactivity:
The operation results are shown in Figure 1.
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
二维码