Skip to main content

I'd highly recommend enclosing your UIImageViewUIImageView in a UIScrollViewUIScrollView. Have the UIImageViewUIImageView display the full image, and set the contentSize on the UIScrollViewUIScrollView to be the same as your UIImageView'sUIImageView's size. Your "window"window into the image will be the size of the UIScrollViewUIScrollView, and by using scrollRectToVisible:animated:scrollRectToVisible:animated: you can pan to particular areas on the image in an animated fashion.

If you don't want scroll bars to appear, you can set the showsHorizontalScrollIndicatorshowsHorizontalScrollIndicator and showsVerticalScrollIndicator propertiesshowsVerticalScrollIndicator properties to NONO.

UIScrollViewUIScrollView also provides pinch-zooming functionality, which may or may not be useful to you.

I'd highly recommend enclosing your UIImageView in a UIScrollView. Have the UIImageView display the full image, and set the contentSize on the UIScrollView to be the same as your UIImageView's size. Your "window" into the image will be the size of the UIScrollView, and by using scrollRectToVisible:animated: you can pan to particular areas on the image in an animated fashion.

If you don't want scroll bars to appear, you can set the showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties to NO.

UIScrollView also provides pinch-zooming functionality, which may or may not be useful to you.

I'd highly recommend enclosing your UIImageView in a UIScrollView. Have the UIImageView display the full image, and set the contentSize on the UIScrollView to be the same as your UIImageView's size. Your window into the image will be the size of the UIScrollView, and by using scrollRectToVisible:animated: you can pan to particular areas on the image in an animated fashion.

If you don't want scroll bars to appear, you can set the showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties to NO.

UIScrollView also provides pinch-zooming functionality, which may or may not be useful to you.

Source Link
Brad Larson
  • 170.3k
  • 45
  • 401
  • 574

I'd highly recommend enclosing your UIImageView in a UIScrollView. Have the UIImageView display the full image, and set the contentSize on the UIScrollView to be the same as your UIImageView's size. Your "window" into the image will be the size of the UIScrollView, and by using scrollRectToVisible:animated: you can pan to particular areas on the image in an animated fashion.

If you don't want scroll bars to appear, you can set the showsHorizontalScrollIndicator and showsVerticalScrollIndicator properties to NO.

UIScrollView also provides pinch-zooming functionality, which may or may not be useful to you.