我正在爲一所大學建設應用程序。根據需要,我將爲每個段落添加採用單獨TextView的段落。有沒有一種方法可以將段落組合在一起。它只是我的想法,這是否可能?這是我工作的代碼片段。如何在活動中提供段落?
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPostalAddress"
android:text="Lorem Ipsum is simply dummy text of the printing and typesetting industry." />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_below="@+id/textView2"
android:layout_marginTop="14dp"
android:inputType="numberSigned"
android:text="+91 12 12345678" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:inputType="phone"
android:text="+91 12 12345678" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView3"
android:layout_below="@+id/textView3"
android:autoLink="email"
android:inputType="textEmailAddress"
android:text="[email protected]" />
在這裏,在我的代碼,我想給兩個電話號碼和電子郵件ID組合在單個TextView中。可能嗎?
爲什麼不用'WebView'或'TextView'和'Html'格式的文本?它支持段落和更多標籤。然後它不需要爲每個段落單獨的Textview。 – user370305
@ user370305,「WebView」,OK我會用。但如何處理Html格式的文本?指導我,我是Android的新手。 – Web