Android 为什么扩展标记为错误的ImageView?

Android 为什么扩展标记为错误的ImageView?,android,android-view,android-support-library,android-custom-view,android-context,Android,Android View,Android Support Library,Android Custom View,Android Context,Android Studio将此行标记为错误: public class ParallaxView extends ImageView 此处显示错误: This custom view should extend android.support.v7.widget.AppCompatImageView instead less... (Ctrl+F1) In order to support features such as tinting, the appcompat library w

Android Studio将此行标记为错误:

public class ParallaxView extends ImageView
此处显示错误:

This custom view should extend android.support.v7.widget.AppCompatImageView instead less... (Ctrl+F1) 

In order to support features such as tinting, the appcompat library will automatically load special appcompat replacements for the builtin widgets.

However, this does not work for your own custom views.  Instead of extending the android.widget classes directly, you should instead extend one of the delegate classes in android.support.v7.widget.AppCompat.
它建议我扩展
AppCompatImageView
,但是我的JUnit测试没有通过,因为
AppCompatImageView
需要一个带有资源的模拟
上下文,而
Imageview
不需要这个

下面是解决另一个问题的问题:


我可以忽略此错误并使用ImageView吗?还有其他解决方案吗?

使用
AppCompat
小部件,您可以在Android棒棒糖前版本的设备上拥有一些材料设计(和其他新)功能


此时,
AppCompatImageView
仅支持背景色调和矢量绘图。如果您不使用它们,那么扩展常规的
图像视图就可以了。

这并不是一个真正的错误。应用程序成功构建,对吗?只有Android Studio将其标记为错误

您可以通过编辑“Appcompat自定义小部件”检查设置将其更改为警告