0

I have a TextView with HTML content inside it. The HTML code contains img tags which are loaded using Html.ImageGetter. The images are displayed fine, but I wan't to make them scale so that the image width spans the entire width of the TextView. This width (and the scaling) should change when the phone is rotated. So basically, I would like to have the same effect as using css rule "width: 100%".

Is this even possible to do using TextViews?

Frank X
  • 175
  • 1
  • 1
  • 8

1 Answers1

0

From the link that as posted to comments, link only answers are not good...

Don't use an . Instead, use a background-image style:

background: transparent url('path/to/image.png') no-repeat scroll center center; 
background-size: contain;

The background-size does the magic, scaling the image up or down so that it snugly fits inside the container.

Community
  • 1
  • 1
TeraTon
  • 435
  • 6
  • 15