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.
display.setText("@string/sport");
sport 是在 Strings.xml 中声明的字符串函数,但是在应用程序中它没有显示?有任何想法吗?
尝试:
display.setText(R.string.sport);
@resource/name引用仅适用于 XML 代码。使用 Java 时,格式为R.<type>.<name>.
@resource/name
R.<type>.<name>