ios - Show a Specific Part of an Image -
Assume that I have a UIImageView
, which is much smaller than that image To see it from contentMode
to UIViewContentModeScaleAspectFill
like you are only viewing a specific part of the image. It automatically shows the center of the image.
I do not want to use other contentMode
above, below, etc. because in my app you can drag the image and as you move it, Displays the part that is below the image. In other words, imageView is like a window for the image.
How can I change the part of the image showing the image's view?
Thank you!
There are various possibilities:
-
A UIImageView Do not use. Use a normal view and manipulate its layer
-
Use a UIImageView. Use the layer and use it
contentRect
. Show an image Full View the image inside the scroll view. Drag the user to scroll. (A scroll view is for which "window" is inside.)
The other is easy because the scroll responds to pull the view, Whereas with the first possibility you have to find different dragging and have to set the contentRect
in response, thus this wheel has to be revised again.
Comments
Post a Comment