Android ImageGetter images overlapping text

后端 未结 5 1386
一个人的身影
一个人的身影 2020-12-01 04:14

I\'m trying to load a block of HTML into a TextView, including images, using

URLImageParser p = new URLImageParser(articleBody, this);
Spanned htmlSpan = Ht         


        
5条回答
  •  失恋的感觉
    2020-12-01 04:24

    may be we need not change container from View to TextView.

       @Override
        protected void onPostExecute(Drawable result) {
            // set the correct bound according to the result from HTTP call
            urlDrawable.setBounds(0, 0, 0 + result.getIntrinsicWidth(), 0
                    + result.getIntrinsicHeight());
    
            // change the reference of the current drawable to the result
            // from the HTTP call
            urlDrawable.drawable = result;
    
            // redraw the image by invalidating the container
            URLImageParser.this.container.setMinimumHeight((URLImageParser.this.container.getHeight()+ result.getIntrinsicHeight()));
            URLImageParser.this.container.requestLayout();
            URLImageParser.this.container.invalidate();
        }
    

提交回复
热议问题