Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Eclipse 给我一个非常奇怪的错误:方法 getColor() 未定义 ColorDrawable 类型
android.graphics.drawable.ColorDrawable dd = new android.graphics.drawable.ColorDrawable(); dd.getColor();
我不知道如何解决它。所有其他方法都存在。什么?
您的目标 API 级别是多少?ColorDrawable.getColor() 是在 API 级别 11 中引入的,因此如果您的目标是较低的 API 级别,您将无法访问该函数。
为什么不将 Drawable 绘制到一个很小的屏幕外Bitmap中,然后调用getPixel来检索您绘制的颜色?