7

I'm using the PhotoView component to zoom and pan an image in Android. However, when it first goes to the page where the image is, it is positioned in the top left corner and when I try to pan or zoom it shifts to the middle. Does anyone have experience with this component and know how to adjust the initial position of the image and prevent it from jumping to the middle of the screen?

Jon
  • 2,644
  • 1
  • 22
  • 31

1 Answers1

0

You can use

PhotoViewAttacher attacher;
attacher.SetScaleType(ImageView.ScaleType.FitCenter)

Some options for ScaleType:

  • ImageView.ScaleType.FitCenter
  • ImageView.ScaleType.FitStart
  • ImageView.ScaleType.Center
  • ImageView.ScaleType.CenterCrop
  • ImageView.ScaleType.CenterInside
Ha Doan
  • 611
  • 6
  • 20