VS的EditText TextView的VS、EditText、TextView

2023-09-07 14:54:06 作者:你是我乱了分寸的心跳。

我读了API和看到的TextView是一个超类的EditText,但我有一个短期和简单的问题:一般来说,EditText上使用时,显示的文本是sbuject改变,无论从用户或应用程序的。 TextView中使用时,显示的文本是恒定/永远相同。这是正确的?

I read the API's and see that TextView is a superclass to EditText, but I have a short and simple question: Generally speaking, EditText is used when the text displayed is sbuject to change, whether it's from the user or the app. TextView is used when the text displayed is to be constant/same forever. Is this correct?

谢谢!

推荐答案

如果你以前做过的任何Java项目中,我看到的TextView 的EditText 只是相同的JLabel 的JTextField 。如果你要问用户输入用户名,您将设置与TextView的(用户名文本,就像你会JLabel的做同样的)。然后你做一个文本框出现用户输入用户名的文本框为的EditText 。的EditText是用户给他们输入的程序。

If you have done any java projects before, I see Textview and EditText are just same as JLabel and JtextField . If you want to ask user to enter username you will set an TextView with ("username " text in that, like you would do the same for JLabel). And then you make a textbox appear for user to enter the username that textbox is EditText. EditText is where user give their inputs for the program.

用户不能更改东西在TextView的,但程序(用户输入正确的用户名后,您可以再TextView中由程序说细节纠正,如果你想,你必须把它写在程序中$ C $设置文本角用户不能让它出现)。用户可以输入任何用户名,但用户名文本框或的TextView 将保持不变为用户名就像在一个正常的登录界面。

User cannot change something in TextView but program can(After user input correct user name you can set text for another TextView by the program saying that "Details correct" if you want that you have to write it in your program code. User can't make it appear). User can input any user name, But "username" textfield or TextView will remain unchange as "username" just like in a normal login interface.