简体   繁体   English

缩放ViewPager的所有页面

[英]Zoom all the pages of ViewPager

I created on application with viewpager.Each pages consists of one imageView that is full screen. 我使用viewpager在应用程序上创建。每个页面都包含一个全屏imageView。 I have implemented zoom on this image view. 我已经在此图像视图上实现了缩放。 I want the zoom scale to be maintained when I scroll to next page in viewPager. 我希望在ViewPager中滚动到下一页时保持缩放比例。 Please help me in implementing the feature. 请帮助我实施此功能。

Store the scaleX and scaleY parameters of the ImageView as instance variables of the activity when the user zooms the image. 当用户缩放图像时,将ImageViewscaleXscaleY参数存储为活动的实例变量。 Then in onPageSelected function of the ViewPager set the scaleX and scaleY properties of the ImageView of the selected item. 然后,在onPageSelected所述的功能ViewPager设置scaleXscaleY所述的性质ImageView所选项目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM