由网友(痴心ㄣ留不住)分享简介:如何设置一个EditText?How can I set the text of an EditText?推荐答案如果您检查文档的EditText,你会发现一个的setText()方法。这需要在字符串和TextView.BufferType.例如:If you check the docs for EditTe...
如何设置一个EditText?
How can I set the text of an EditText?
推荐答案
如果您检查文档的EditText,你会发现一个的setText()
方法。这需要在字符串
和TextView.BufferType.例如:
If you check the docs for EditText
, you'll find a setText()
method. It takes in a String
and a TextView.BufferType
. For example:
EditText editText = (EditText)findViewById(R.id.edit_text);
editText.setText("Google is your friend.", TextView.BufferType.EDITABLE);
相关推荐
最新文章