gpt4 book ai didi

android - android 中的 ColorDrawable 中没有方法 "getColor"

转载 作者:太空狗 更新时间:2023-10-29 12:52:51 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com