因此,在我的strings.xml中,我有一个很长的文本,我想以某种方式格式化它。如何将制表符放在正文的第一句前面?另外,新行的代码是什么?谢谢
发布于 2012-12-30 23:05:20
为选项卡添加\t
,为新行添加\n
。
发布于 2012-12-30 23:14:25
如果要插入制表符,请使用\n
表示换行符,使用\t
表示换行符。
还可以使用一些XML标记进行基本格式设置:<b>
表示粗体文本,<i>
表示斜体,<u>
表示带下划线的文本
更多信息:
https://developer.android.com/guide/topics/resources/string-resource.html
发布于 2015-04-10 15:28:19
使用\t添加制表符,使用\n添加新行,下面是一个简单的示例。
<string name="list_with_tab_tag">\tbanana\torange\tblueberry\tmango</string>
<string name="sentence_with_new_line_tag">This is the first sentence\nThis is the second scentence\nThis is the third sentence</string>
https://stackoverflow.com/questions/14091760
复制相似问题