android - Question on importing two classes with the same name - android.graphics.Color
问题描述
I currently have a imported color class from another Android Library:
import com.google.ar.sceneform.rendering.Color;
but I need to import another color class:
import android.graphics.Color;
but after typing this import, it gives me the error:
so I have to end up removing the second import and use it manually like this:
mBtnColor.setColorFilter(android.graphics.Color.parseColor(color));
is there a way I can import both classes? or maybe use the second import without typing android.graphics.Color
?
解决方案
创建两个类:一个继承第一个 Color,什么也不做,称为 AndroidGraphicsColor,另一个继承相应的类,称为 AndroidSceneFormRenderingColor。然后使用它们。
推荐阅读
- sql - 在 phpmyadmin 中查找重复数据
- github - 删除密码验证支持后,如何从公共 Windows 推送到 GitHub?
- reactjs - React-spring with gatsby - 安装时出错
- android - Android在请勿打扰模式下播放rigtone/alarm
- google-colaboratory - Google Colab Pro 充电问题
- node.js - 为什么在 webpack 配置中使用 __dirname 和 path.resolve?
- teradata - TD 上的 Teradata RegExp_Split_To_Table 错误
- android - d8:从命令行使用它时出现奇怪的异常
- angular - 带有 Angular 11 的 Google Chart Timeline。许多选项不起作用
- php - 在 php shell_exec 中运行 kubectl 返回并为空列表