解决strings.xml格式化占位符错误:Multiple substitutions specified in non-positional format
使用strings.xml进行格式化占位符时报错:
Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
检查后发现是格式化字符串中包含多个占位符导致
解决案例:
<string name="test">HomePage: %1$s, Author: %2$s</string>
<string name="order_total_hint">Total %1$d products(including shipping %2$s%3$.2f)</string>
版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/02/26/resolve-string-xml-formatting-placeholder-error-multiple-substitutions-specified-in-non-positional-format/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。
THE END
0
二维码
打赏
海报
解决strings.xml格式化占位符错误:Multiple substitutions specified in non-positional format
使用strings.xml进行格式化占位符时报错:
Multiple substitutions specified in non-positional format; did you mean to add the formatted="false&quo……
文章目录
关闭
共有 0 条评论