相关疑难解决方法(0)

在ImageView中获取可绘制的ID

我有一个ImageView并设置了一个drawable.现在我需要ImageView动态获取可点击事件的ID .我怎么才能得到它?

imgtopcolor = (ImageView) findViewById(R.id.topcolor); 
imgtopcolor.setImageResource(R.drawable.dr);  // How do I get this back?
Run Code Online (Sandbox Code Playgroud)

现在触摸事件imgtopcolor我想要绘制id因为我每次都设置不同的drawable并且想要将drawable与其他

android android-imageview android-drawable

49
推荐指数
3
解决办法
11万
查看次数