为什么“values.xml”中定义的值会被覆盖?
我有从AndroidStudio初始化的清洁Android项目。我正在尝试更改actionMenuitem
的样式,因此它不在大写中。
我发现有一个abc_config_actionmenuitemallcaps
布尔值\ appcompat-1.4.1.4.1.4.1 \ res \ values \ values \ values.xml
。
我尝试通过此value.xml
文件覆盖它:
<resources>
<bool name="abc_config_actionMenuItemAllCaps">false</bool>
</resources>
但是它不起作用。
我并不是要找到一个解决actionMenuitem
小写的解决方案。我试图得到推理的原因,为什么覆盖布尔值不起作用。
I have clean Android project initialized from AndroidStudio. I am trying to change style of actionMenuItem
so it is not in uppercase.
I found out that there is an abc_config_actionMenuItemAllCaps
boolean set in \appcompat-1.4.1\res\values\values.xml
.
I tried to override it by this values.xml
file:
<resources>
<bool name="abc_config_actionMenuItemAllCaps">false</bool>
</resources>
but it does not work.
I am not trying to find a solution for having actionMenuItem
lowercase. I am trying to get reasoning behind why overriding the boolean is not working.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为库从其值文件获取值,而不是从应用的
values.xml
获取值。例如:您可以使用以下命令获得一些布尔值:
但是库使用:
正如您所看到的路径不同,因此根本不可能以这种方式覆盖。
It's because library gets the value from its values file not from your app's
values.xml
. For instance:You get some boolean value using:
but library uses:
As you can see paths are different, so it is simply impossible to override in this way.