2014-02-24 86 views
-1
display a text in format 

    email.setText(text); 
  1. 列表項如何在格式顯示文本

    文本=「1。如果你喝飲料,並有一個誠實的飯你就不會感到筋疲力盡或者疲倦。」 「捐獻血液不會讓你血液稀少;實際上你捐獻血液後仍然可能有過剩血液。」 「3,在獻血時你不會暈倒或感到不舒服,這通常是一個典型的想法!」 +「4.如果你捐獻血液,你不會得艾滋病。」 +「5.如果你想喝酒,你可以在連續的一天。」 +「」 +「將愛與禮物分享給最需要的人,捐血!」;

+4

在每個點之後使用'\ n' .. –

回答

1
在你的資源

做類似如下:

<?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> 

則是指它的代碼在你的活動如下所示:

email.setText(getString(R.string.myMessage)); 

,並請給我一些反饋

希望有幫助。

2

基本上\n會將內容打印到下一行。所以請像下面那樣使用它。

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!"; 
+2

hmmmmm right ... –