我想顯示一段長文本如下。這裏是來自Flipboard的快照。如何在TextView中使第一個字符比其他字符大得多
爲了達到這樣的效果,我試圖用2 TextView
秒。
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40sp"
android:text="T" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="76dp"
android:text="op British supermarket Tesco (LSE: TSCO) (NASDAQOTH: TSCDY.US) is due to announce its half year results on" />
</LinearLayout>
我收到以下結果。
非常接近。但不是我想要的。這是因爲第2行和第3行不是最左邊的。第二行和第三行最左邊的空間由大字體TextView
佔據。
有沒有更好的技術,我可以使用,比如一個在Flipboard的的?
http://stackoverflow.com/questions/2159847/is-there-any-example-about-spanned-and-spannable-text – Andrew
只需使用'HTML'標籤和使用'HTML載入您的數據。 fromHtml()'在'TextView'中或者在'WebView'中。 – user370305
@Andrew Spannable文本是一個好主意。謝謝。我補充說,作爲答案。 –