2

For my app I need to get the height and width of an image. However, the image has no params when I try to get them in the onCreate/ onStart/ onResume method. At which point can I get the values of the image/ has the image been loaded?

Thanks in advance! :)

L. Fath
  • 65
  • 1
  • 5

1 Answers1

1

You need to use ViewTreeObserver with ViewTreeObserver.OnPreDrawListener.

For more details, check this answer: How to get the width and height of an android.widget.ImageView?

Denysole
  • 3,903
  • 1
  • 20
  • 28