我一直在阅读有关在ImageView中更改图像的文章。
但是每个人都要求使用自定义图像设置ImageView,而我想在其中设置系统图像。
我做的:
ledicon.setImageDrawable(getResources().getDrawable(R.drawable.presence_busy));
但是Eclipse告诉我,无法识别present_busy。
为什么?
我在XML文件中使用presentation_online,
android:src="@android:drawable/presence_online"
而且一切正常。
试试这个:
ledicon.setImageDrawable(getResources().getDrawable(android.R.drawable.presence_busy));
(访问系统资源时,您必须在android.R中查看它们,而不是您自己的。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句