gpt4 book ai didi

android - ADT 在 Strings.xml 中显示错误

转载 作者:IT老高 更新时间:2023-10-28 22:00:31 24 4
gpt4 key购买 nike

在 Gingerbread 发布后,我将我的 ADT 更新到了最新版本。现在

<string name="date_format">%d:%d %s</string>

显示以下错误

Multiple annotations found at this line:
- error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false"
attribute?
- error: Unexpected end tag string

以前的 ADT 版本运行良好。难道我做错了什么?每当有超过 1 个格式说明符时,我都会收到此错误。

最佳答案

或者,您也可以修改 % 格式说明符以使用参数索引,如下所示:

<string name="date_format">%1$d:%2$d %3$s</string>

Android Reference Docs 中有关 Formatter 类的更多信息.

关于android - ADT 在 Strings.xml 中显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4484453/

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