.getDrawable() 不适合我 [ Android ]
.getDrawable() didn't Work with Me [ Android ]
.getDrawable()
对我不起作用,我不知道为什么我尝试了很多方法都没有结果,比如
应用程序 运行 没有错误,但 .getDrawable()
没有运行。它被划掉了。我尝试使用 getDrawable(id, Theme theme)
。我在 Theme Place 中替换 Null
也没有用。
尝试这样的事情:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi, this.getTheme()));
} else {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi));
}
}
.getDrawable()
对我不起作用,我不知道为什么我尝试了很多方法都没有结果,比如
应用程序 运行 没有错误,但 .getDrawable()
没有运行。它被划掉了。我尝试使用 getDrawable(id, Theme theme)
。我在 Theme Place 中替换 Null
也没有用。
尝试这样的事情:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi, this.getTheme()));
} else {
img.setImageDrawable(getResources().getDrawable(R.drawable.henedi));
}
}