http://code.google.com/p/android-flowtextview/
![enter image description here](https://i.stack.imgur.com/nZea0.png)
Ví dụ sử dụng:
<com.pagesuite.flowtext.FlowTextView
android:id="@+id/tv"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:padding="10dip"
android:src="@drawable/android" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="400dip"
android:padding="10dip"
android:src="@drawable/android2" />
</com.pagesuite.flowtext.FlowTextView>
mã của bạn:
cho Text:
tv = (FlowTextView) findViewById(R.id.tv);
tv.setText("my string"); // using plain text
tv.invalidate(); // call this to render the text
cho HTML:
tv = (FlowTextView) findViewById(R.id.tv);
Spanned spannable = Html.fromHtml("<html ... </html>");
tv.setText(spannable); // using html
tv.invalidate(); // call this to render the text
tôi nhận văn bản từ webservice làm cách nào tôi có thể đặt văn bản đó thành html – Victor
Bạn không phải chuyển văn bản thành html. không sử dụng spanable chỉ tv.setText (yourtextfromwebservice); – Talha
làm cách nào tôi có thể chuyển đổi văn bản webservice đó thành html @talhakosen – Victor