加入收藏 | 设为首页 | 会员中心 | 我要投稿 云计算网_泰州站长网 (http://www.0523zz.com/)- 视觉智能、AI应用、CDN、行业物联网、智能数字人!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

Android开发: strings.xml文件中的问题

发布时间:2021-12-14 21:19:30 所属栏目:PHP教程 来源:互联网
导读:编辑strings.xml的时候 在行string name=myurlhttp://code.dd.com/rr?q=%rr.55/string 提示下面的错误 Multiple annotations found at this line: - error: Multiple substitutions specified in non-positional format; did you mean to add the formatted=f
编辑strings.xml的时候
在行<string name="myurl">http://code.dd.com/rr?q=%rr.55</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
 
出现这个错误的原因主要是因为strings字串中包含百分号(%),
 
 
 
有几种方式解决
1.用两个百分号表示一个百分号即
<string name="myurl">http://code.dd.com/rr?q=%%rr.55</string>
2.用转义符表示
<string name="myurl">http://code.dd.com/rr?q=%rr.55</string>
3.根据错误提示可知,如果字符串无需格式化,可在<string 标签上增加属性:formatted="false",即
 
<string name="myurl" formatted="false">http://code.dd.com/rr?q=%rr.55</string>

(编辑:云计算网_泰州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读