Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A work around I can think off the top of my head and from previous issues with <code>TextView</code> formatting, the best way is to have, say, a <code>RelativeLayout</code>, and just place 3 separate Views inside of it. It will represent the <code>TextView</code> that is right next to the image, the <code>ImageView</code> itself next to the text, and then the last <code>TextView</code> under the first text, but with the <code>layout_width="match_parent"</code>. There is no other way to do this with the <code>TextView</code> or <code>ImageView</code> otherwise.</p> <p><strong>EDIT:</strong></p> <p>The only other workaround I believe you can do if you are so intent on using 1 TextView, I would suggest using <code>SpannableStringBuilder</code> with <code>SpannableString</code>. I didn't originally give you that as an option for a specific reason. If you go back to that link you posted on your question, one of the answers say they found an answer. I believe that person linked to a good resource, but they are wrong for what your needs are. When using <code>SpannableStringBuilder</code>, you are essentially creating a string that can have potentially many different version of a single string into one, like 3 different colors on a single string, or strings with 3 different sizes, all in one <code>TextView</code>. Like what you need.</p> <p>Now the link talks about putting an image and having the text wrap around it nicely, but its not that simple, and that example isn't what you need. What you could do to provide it all in one <code>TextView</code> is to add line breaks after the first few lines where you know the image will be to the right, and then not do so after the image. But the thing is it still needs to go in a <code>RelativeLayout</code>. But instead of two TextViews you only need one. Just place the TextView at the top left of whatever the parent is and the ImageView to the top right of whatever the parent is. This simulates a <code>floating</code> element. But I think doing it that way is more trouble than its worth. It really is because you have to do calculations to figure out where to put the line breaks, etc. You are better off using two <code>TextView</code>s in which to make it look like you need. So in my opinion, DO NOT USE <code>SpannableStringBuilder</code>, but if you do not mind trying to figure out all that spacing, that does give you what you need with a single TextView.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload