html-textview icon indicating copy to clipboard operation
html-textview copied to clipboard

How to Set the Size of Pictures

Open HelloAnyu opened this issue 5 years ago • 4 comments

How to Set the Size of Pictures?thanks

HelloAnyu avatar Jun 18 '19 07:06 HelloAnyu

I also want to know the answer. Who can answer it?

asceee avatar Sep 13 '19 12:09 asceee

It's not simple way to set size.You can use textView.setHtml(HTML_TEXT, new HtmlHttpImageGetter(textView,null,true)); ,if you just set the width of image to match_parent(at the same time, the scale is correct).

Iverlei avatar Oct 10 '19 08:10 Iverlei

@Iverlei Thank You, your code work for me..
both Your HtmlTextView and its Parent Layout width should be match_parent

and Add this line in Java textView.setHtml(HTML_TEXT, new HtmlHttpImageGetter(textView,null,true));

frared358 avatar Mar 24 '20 08:03 frared358

In my case it was not enough to show image normally, so I added 1 method

textTextView.setHtml(articleResponse.article_html, HtmlHttpImageGetter(textTextView, null, true).apply { enableCompressImage(true) })

almakhanov avatar Jul 13 '20 13:07 almakhanov