由于此标记我收到错误此字符串标记有什么问题,任何人都可以帮助我。
<string name="Walt_desc">At the age of 50, Walt works as a high school chemistry teacher in Albuquerque, New Mexico, providing instruction to uninterested and disrespectful students.Since the job does not pay enough, he must work a second job at a car wash, which proves to be particularly humiliating when he has to clean the cars of his own students.Walter is married to Skyler White, they have a teenage son named Walter Jr., who has cerebral palsy. Skyler is also pregnant with their second child, Holly, who is born at the end of season two. Walt's other family includes Skyler's sister, Marie Schrader, her husband, Hank, who is a DEA agent, and his mother, who is never seen</string>
提前致谢。
答案 0 :(得分:3)
'
中有一个未转义的撇号Walt's
。替换为Walt\'s
。同样在Skyler\'s
。
答案 1 :(得分:2)
如果字符串中有撇号或引号,则必须将其转义或将整个字符串括在其他类型的引号中。例如,以下是一些有效和无效的叮咬:
<string name="good_example">"This'll work"</string>
<string name="good_example_2">This\'ll also work</string>
<string name="bad_example">This doesn't work</string>
所以,你的代码应该是,
<string name="Walt_desc">"At the age of 50, Walt works as a high school chemistry teacher in Albuquerque, New Mexico, providing instruction to uninterested and disrespectful students.Since the job does not pay enough, he must work a second job at a car wash, which proves to be particularly humiliating when he has to clean the cars of his own students.Walter is married to Skyler White, they have a teenage son named Walter Jr., who has cerebral palsy. Skyler is also pregnant with their second child, Holly, who is born at the end of season two. Walt's other family includes Skyler's sister, Marie Schrader, her husband, Hank, who is a DEA agent, and his mother, who is never seen"</string>
或
<string name="Walt_desc">At the age of 50, Walt works as a high school chemistry teacher in Albuquerque, New Mexico, providing instruction to uninterested and disrespectful students.Since the job does not pay enough, he must work a second job at a car wash, which proves to be particularly humiliating when he has to clean the cars of his own students.Walter is married to Skyler White, they have a teenage son named Walter Jr., who has cerebral palsy. Skyler is also pregnant with their second child, Holly, who is born at the end of season two. Walt\'s other family includes Skyler\'s sister, Marie Schrader, her husband, Hank, who is a DEA agent, and his mother, who is never seen</string>