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?
Asked
Active
Viewed 685 times
7
-
the source is here: https://github.com/chrisbanes/PhotoView – Jason Oct 03 '15 at 18:34
-
2post your code and your layout – CDrosos Oct 10 '15 at 17:14
-
what ScaleType are you using? https://github.com/chrisbanes/PhotoView/issues/308 – George Birbilis Apr 04 '16 at 22:33
1 Answers
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