简体   繁体   English

Android Studio中出现“在其他配置中覆盖资源”错误。

[英]what is “ Override resource in other configuration ” error in Android studio.

It happens when I gave the scale type to an image and the image doesn't get changed when i change the scale type. 当我为图像指定比例类型时会发生这种情况,而当我更改比例类型时图像不会改变。 If I click on the error it takes me to " Select resource directory" where it asks me for a directory name and resource type. 如果单击错误,将带我到“选择资源目录”,并在其中询问目录名称和资源类型。 What should i do to debug the error? 我应该怎么做才能调试错误?

It is an recommendation by android studio to provide alternative resources. android studio建议提供替代资源。 Let's consider a case where you are using some properties which are supported only after certain API level. 让我们考虑一种情况,您使用的某些属性仅在某些API级别之后才受支持。 For ex. 对于前。 i am using android:drawableTint="@color/colorPrimary" property with TextView which is supported from API 23 so it would give me suggestion "Override resouce in layout-v23".This is just an example to make you understand the meaning of that error so there maybe other cases where this error might be generated. 我在API 23 android:drawableTint="@color/colorPrimary"属性与TextView一起使用,因此它会给我建议“在layout-v23中覆盖资源”。这只是一个示例,可让您了解其含义错误,因此在其他情况下可能会产生此错误。 You can visit following site for more info on Providing alternative resources: 您可以访问以下站点,以获取有关提供替代资源的更多信息:

https://developer.android.com/guide/topics/resources/providing-resources#AlternativeResources https://developer.android.com/guide/topics/resources/providing-resources#AlternativeResources

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM