tv.setText(getResources().getString(R.string.content));能夠直接寫成tv.setText(R.string.content)嗎,感覺這樣快一些

夏天的紅豆
2014-09-02
4 回答
舉報
0/150
提交
取消
2015-12-03
可以的,text.setText(int resid) 有這個方法直接寫R.string.content。給text賦值
2014-11-22
R.String.content是R.java中的content的資源id
2014-11-21
挺好的啊
2014-09-02
不可以,R.string.content是一個整型數,需要使用getResources().getString(R.string.content)這種形式來獲取字符串