Android uses glide to get an example of the true width and height of the picture

preface

Sometimes it is necessary to obtain the width and height of the network image to set the size of the image display. Many people will directly use glide's load monitor to get the width and height of the image, but what they get is not the real width and height of the image, but the width and height of the image displayed in ImageView. As follows:

To get the true width and height of the picture, you should use glide's target. As follows:

Complete code

MainActivity.java

activity_ main.xml

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>