Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在一个类中,如果我想将文本设置为我拥有的字符串的文本值,那么代码是什么?
我有:
TextView textView = (TextView) findViewById(R.string.noFaceFive); textView.setText(textView);
但 setText 说:
setText(CharSequence)类型中的方法TextView不适用于参数(TextView)。
setText(CharSequence)
TextView
(TextView)
是否有设置 Text 来显示字符串的文本?我是认真的放屁……谢谢!
您似乎正在尝试将 textView 的 text 属性设置为 textView 本身。setText() 接受一个字符串,所以尝试...
textView.setText("The text you want to appear");