Java 如何以一种格式显示文本
列表项 text=“1.如果你喝了液体并吃了一顿正餐,你就不会感到筋疲力尽或疲倦。” +“2.献血不会使你的血液量减少;事实上,即使在献血后,你仍然可能有多余的血液。” +“3.献血时不会晕倒或感到不舒服。这通常是一个典型的想法!” +“4.如果你献血,就不会得艾滋病。” +“5.如果你想喝酒,你可以连续一天喝酒。” +"" +“把爱和生命分享给最需要的人。献血!”Java 如何以一种格式显示文本,java,android,xml,validation,android-activity,Java,Android,Xml,Validation,Android Activity,列表项 text=“1.如果你喝了液体并吃了一顿正餐,你就不会感到筋疲力尽或疲倦。” +“2.献血不会使你的血液量减少;事实上,即使在献血后,你仍然可能有多余的血液。” +“3.献血时不会晕倒或感到不舒服。这通常是一个典型的想法!” +“4.如果你献血,就不会得艾滋病。” +“5.如果你想喝酒,你可以连续一天喝酒。” +"" +“把爱和生命分享给最需要的人。献血!” 基本上,\n会将内容打印到下一行。所以像下面那样使用它 display a text in format e
基本上,
\n
会将内容打印到下一行。所以像下面那样使用它
display a text in format
email.setText(text);
在您的资源中,请执行以下操作:
email.setText(text);
text="1. You won’t feel drained or tired if you drink fluids and have an honest meal."
+" \n 2. Donating blood won't leave you low of blood; in reality you still may have surplus blood even after donation."
+" \n 3. You will not faint or feel uncomfortable while donating blood. This is often a typical idea!"
+" \n 4. You will not get AIDS if you donate blood."
+" \n 5. If you want to consume alcohol, you'll be able to - on the consecutive day."
+""
+" \n Share love and gift life to someone who needs it the most. Donate blood!";
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="myMessage">1. You won’t feel drained or tired if you drink fluids and have an honest meal\n
2. Donating blood won't leave you low of blood; in reality you \n
etc ..
</string>
</resources>
请给我一些反馈
希望有帮助 在每个点后使用
\n
。。
email.setText(getString(R.string.myMessage));