MOH*_*HRE 9 android imagebutton
我应该如何获得imageButton的当前图像资源?我需要这样的东西:
imageButton.getImageResource();
Run Code Online (Sandbox Code Playgroud)
非常感谢
dim*_*suz 23
我想你不能,目前的API不允许这样做.但如果你真的需要这个,你可以这样做:
imageButton.setImageResource(R.drawable.your_resource);
imageButton.setTag(R.drawable.your_resource);
//
// somewhere later...
//
Integer resource = (Integer)imageButton.getTag();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21093 次 |
| 最近记录: |