gpt4 book ai didi

android - 为什么strings.xml 和styles.xml 中没有DTD?

转载 作者:搜寻专家 更新时间:2023-11-01 09:19:41 25 4
gpt4 key购买 nike

我新建了一个android studio项目,发现没有

<?xml version="1.0" encoding="utf-8"?>

标签在strings.xml的开头和 styles.xml但它存在于 colors.xml 中.

为什么它不在 strings.xml 中和 styles.xml

strings.xml 中是否缺少此标记?和 styles.xml还好吗?

可以手动添加到 strings.xml 中吗?和 styles.xml文件?

谢谢!!!

最佳答案

<?xml version="1.0" encoding="utf-8"?>称为“XML 声明”行,它在技术上是可选的。

Why is it not present in the strings.xml and styles.xml?

这可能是由于您的 android studio 存在技术困难,可以通过重启来解决。

Is the absence of this tag in strings.xml and styles.xml fine?

它的存在不是强制性的,但当您向文件中插入非 ASCII 字符时,缺少它可能会导致编译时错误,例如 Norwegian æ ø å , or French ê è é.

Is it fine to manually add it into strings.xml and styles.xml files?

完全正确!您甚至还有额外的选择

<?xml version="1.0" encoding="us-ascii"?>
<?xml version="1.0" encoding="windows-1252"?>
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-16"?>

关于android - 为什么strings.xml 和styles.xml 中没有DTD?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57315133/

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