为了账号安全,请及时绑定邮箱和手机立即绑定

如何在具有自定义标签的 xml 中添加新行?

如何在具有自定义标签的 xml 中添加新行?

繁星淼淼 2023-04-26 13:36:04
我正在开发一个离线故事 android 应用程序。但它有一个非常大的问题。每当我在故事中添加一个段落但所有文本都在混合时。我的意思是段落没有显示。请参阅说明中的图片以正确理解。示例 XML 代码:<root>  <story_id>1</story_id>    <story_title>Half of the Profit</story_title>    <story_date>25/07/2017</story_date>    <story_des>A rich man wanted to give a great feast to his friends. He got all kinds of dishes prepared but he could not get fish. He offered a reward to the man who would bring it. After some time a fisherman brought a big fish.        But the gate keeper would not let him in till he had promised to give him half the reward.    The fisherman agreed. The rich man was highly pleased and wanted to give him a lot of money, but the fisherman refused to take it. Instead, he demanded a hundred lashes on his back. All were surprised. At last the rich man ordered a servant to give him a hundred lashes.        When the fisherman had received fifty, he asked them to stop as he had a partner in the business.    It was the gatekeeper. The rich man understood the whole thing. He was given the remaining fifty lashes dismissed from the service. The rich man gave the fisherman a handsome reward.   </story_des></story>                                                              </root>输出:它在应用程序中的外观截图
查看完整描述

1 回答

?
白猪掌柜的

TA贡献1893条经验 获得超10个赞

使用<p>标签创建一个新段落,如下所示:


<root>

  <story_id>1</story_id>

    <story_title>Half of the Profit</story_title>

    <story_date>25/07/2017</story_date>

    <story_des>

        &lt;p&gt;A rich man wanted to give a great feast to his friends. He got all kinds of dishes prepared but he could not get fish. He offered a reward to the man who would bring it. After some time a fisherman brought a big fish.&lt;/p&gt;

        &lt;p&gt;But the gatekeeper would not let him in till he had promised to give him half the reward.&lt;/p&gt;

        &lt;p&gt;The fisherman agreed. The rich man was highly pleased and wanted to give him a lot of money, but the fisherman refused to take it. Instead, he demanded a hundred lashes on his back. All were surprised. At last the rich man ordered a servant to give him a hundred lashes.&lt;/p&gt;

        &lt;p&gt;When the fisherman had received fifty, he asked them to stop as he had a partner in the business.&lt;/p&gt;

        &lt;p&gt;It was the gatekeeper. The rich man understood the whole thing. He was given the remaining fifty lashes dismissed from the service. The rich man gave the fisherman a handsome reward.&lt;/p&gt;

   </story_des>

</story>                                                              

</root>


查看完整回答
反对 回复 2023-04-26
  • 1 回答
  • 0 关注
  • 92 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信