Eclipse 给我带来了非常奇怪的错误: ColorDrawable 类型未定义方法 getColor()
android.graphics.drawable.ColorDrawable dd =
new android.graphics.drawable.ColorDrawable();
dd.getColor();
我不知道如何修复它。所有其他方法都存在。什么鬼?
最佳答案
您的目标 API 级别是多少? ColorDrawable.getColor() 是在 API 级别 11 中引入的,因此如果您的目标是较低的 API 级别,您将无法访问该函数。
关于android - android 中的 ColorDrawable 中没有方法 "getColor",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10235173/