在string.xml中字符串末尾添加空格失败

本文讨论了在Android的TextView中使用不同类型的空格字符时遇到的问题。当使用不可见的空格如'nbs...'。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.tuicool.com/articles/riYzimE
  1. This doesnt work with wrap_content of a textview, when the space occurs at the end of the text. The textview does not maintain the width that is taken up by the 'space' character. – toobsco42 Nov 23 '13 at 4:13

  2. This will add a non-breakable space. It is different from a regular space and will not work well with certain functions (XPath's normalize-space, for example). Try using (regular space) instead of  . @toobsco42 – shwartz Feb 10 '14 at 16:43

System.Xml.XmlException HResult=0x80131940 Message=XML 注释中不能包含“--”,并且“-”不能是最后一个字符。 第 49 行,位置 4。 Source=System.Xml StackTrace: 在 System.Xml.XmlTextReaderImpl.Throw(Exception e) 在 System.Xml.XmlTextReaderImpl.Throw(String res, String arg) 在 System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type, Int32& outStartPos, Int32& outEndPos) 在 System.Xml.XmlTextReaderImpl.ParseCDataOrComment(XmlNodeType type) 在 System.Xml.XmlTextReaderImpl.ParseComment() 在 System.Xml.XmlTextReaderImpl.ParseElementContent() 在 System.Xml.XmlTextReaderImpl.Read() 在 System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace) 在 System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) 在 System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) 在 System.Xml.XmlDocument.Load(XmlReader reader) 在 System.Xml.XmlDocument.LoadXml(String xml) 在 AutoGenerateConfig.FileParser.FileActions.GetFileXmlDocument(String xmlContent, XmlDocument doc) 在 C:\Users\wangdongchang\source\repos\autogenerateconfig2\AutoConfig\AutoGenerateConfig\FileParser\FileActions.cs 中: 第 99 行 在 AutoGenerateConfig.XmlParser.XmlParser.Xml2Doc(TemplateInfo templateInfo) 在 C:\Users\wangdongchang\source\repos\autogenerateconfig2\AutoConfig\AutoGenerateConfig\FileParser\XmlParser.cs 中: 第 658 行 在 AutoGenerateConfig.XmlParser.XmlParser.ADD(TemplateInfo templateInfo) 在 C:\Users\wangdongchang\source\repos\autogenerateconfig2\AutoConfig\AutoGenerateConfig\FileParser\XmlParser.cs 中: 第 550 行 在 AutoGenerateConfig.XmlParser.XmlParser.<>c__DisplayClass25_0.<LoadXmlFileGroup>b__0() 在 C:\Users\wangdongchang\source\repos\autogenerateconfig2\AutoConfig\AutoGenerateConfig\FileParser\XmlParser.cs 中: 第 506 行 在 System.Threading.ThreadHelper.ThreadStart_Context(Object state) 在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 在 System.Threading.ThreadHelper.ThreadStart() 此异常最初是在此调用堆栈中引发的: [外部代码] AutoGenerateConfig.FileParser.FileActions.GetFileXmlDocument(string, System.Xml.XmlDocument) (位于 FileActions.cs 中) AutoGenerateConfig.XmlParser.XmlParser.Xml2Doc(AutoGenerateConfig.ConfigManager.TemplateInfo) (位于 XmlParser.cs 中) AutoGenerateConfig.XmlParser.XmlParser.ADD(AutoGenerateConfig.ConfigManager.TemplateInfo) (位于 XmlParser.cs 中) AutoGenerateConfig.XmlParser.XmlParser.LoadXmlFileGroup.AnonymousMethod__0() (位于 XmlParser.cs 中) [外部代码]
最新发布
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值