tags:

views:

112

answers:

2

Can you please tell me if there is a way to layout text around an image? Like this:

------  text text text
|    |  text text text
-----   text text text
text text text text
text text text text

I have gotten a response from an android developer about this question. But I am not sure what he means by doing my own version of TextView? Thank for any tips.

On Mon, Feb 8, 2010 at 11:05 PM, Romain Guy wrote:

Hi,

This is not possible using only the supplied widgets and layouts. You could write your own version of TextView to do this, it shouldn't be hard.

A: 

Just use a float:

<img src="Image URL" style="float:left; margin-right: 5px;" />
Jonathan
This will work if TextView can be replaced by WebView in context of the task. If so, than instead of using android layout we can rely on html layout engine.
alex2k8
Which is to say, this is the wrong solution.
fiXedd
Yeah. Replace TextView with WebView will be too heavy for my usage. Thank you for the answer though.
silverburgh
A: 

"But I am not sure what he means by doing my own version of TextView?"

He means that you can extend the class android.widget.TextView (or Canvas or some other renderable surface) and implement your own overriding version that allows embedded images with text flowing around them.

This could be quite a lot of work depending on how general you make it.

Peter vdL