Can we enlarge the image to the full size of the device as a media player in iOS?

We can scale the media player to full size in iOS using the step action. How to implement this type of scaling with ImageView in iOS?

+4
source share
2 answers

Steps:

1) You need to add UIImageView as a subset of UIScrollView .

2) Set the UITapGestureRecognizer in the scroll view and set the numberOfTapsRequired property to 1 .

3) In the gesture recognizer callback method, simply set the zoomScale property to the zoomScale view to the desired zoom value.

4) Remember to set maximumZoomScale and minimumZoomScale to UIScrollView .

+2
source
  • Add Pinch Recognizer to imageView
  • Inside the recognition method - set the image viewing frame to the full size of the image with animation
  • Hide status bar with [setStatusBarHidden:YES] in UIApplication
0
source

Source: https://habr.com/ru/post/1485617/


All Articles