您的位置:首页 > 移动开发 > Android开发

Android Accessing Resources

2015-12-02 23:52 495 查看
》All resource IDs are defined in your project's
R
class, which the
aapt
tool
automatically generates.

》两种获取资源的方法:In code: Using
a static integer from a sub-class of your
R
class;In code: Using
a static integer from a sub-class of your
R
class。

mageView
to
use the
res/drawable/myimage.png
resource using
setImageResource()
:

ImageView imageView = (ImageView) findViewById(R.id.myimageview);
imageView.setImageResource(R.drawable.myimage);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: