Html.ImageGetter TextView

前端 未结 5 1693
猫巷女王i
猫巷女王i 2020-11-27 17:58

So Im using ImageGetter to display the images from JSON blog posts. Im getting the correct source in the log but the URL changes when it reaches setBounds. Any ideas?

<
5条回答
  •  旧巷少年郎
    2020-11-27 18:26

    If you have mTV (I mean TextView), you can calculate based on its dimensions (mTv.getWidth() and mTv.getHeight()) and dimension of created bitmap (bitmap.getWidth() and bitmap.getHeight()) and set these values as new dimensions of TextView (mTv).

提交回复
热议问题