Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:52:28+00:00 2026-06-14T02:52:28+00:00

I have an UIScrollView which contains one UIImageView. Everything is working correctly, I can

  • 0

I have an UIScrollView which contains one UIImageView. Everything is working correctly, I can zoom in and out, when zoomed in I can pan around, etc.

The problem that I am unable to solve is how to pan a zoomed out image around the screen. The user needs to be able to zoom the image out until it’s small, and then move that small image to any point on the screen. Sadly, it’s stuck in the center of the screen (usually, it would be stuck in the top left corner but I did fix that problem).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:52:30+00:00Added an answer on June 14, 2026 at 2:52 am

    There are a couple of things you need to do here. I suggest doing them in viewWillAppear rather than viewDidLoad because if you’re using storyboards, it doesn’t work quite right in viewDidLoad.

    First, you need to set the content size property of your scroll view to be the size of the photo itself because you want the entire area of your photo to be scrollable.

    self.scrollView.contentSize=self.photoShown.size; 
    

    photoShown is UIImage. scrollView is a UIScrollView

    Second, you need to set the frame of your UIImageView that houses your image to be the size of your image:

    self.imageView.frame=CGRectMake(0,0, self.photoShown.size.width, self.photoShown.size.height);
    

    if you haven’t done this, then the frame of the UIImageView is the size of the screen itself and there is simply nowhere to pan. That’s why it needs to be bigger, so you can pan to the regions not currently shown on screen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Image inside UIScrollView which i can zoom in and out. I
in my app i have UIImageView inside UIScrollview which i can zoom in and
I have a UIScrollView which contains multiple UIImageViews. I want to know which UIImageView
I have a UIScrollView which contains many UIImageView s, UILabels, etc... the labels are
I have a view in UIScrollView in which the user can zoom into. The
I have a pretty big uiscrollview (1700p) which contains a uiimageview as the background,
I have a UIView which contains many items like UIScrollView. How can I specify
I have a UIScrollView that contains multiple UITableViews horizontally - all of which are
I have a UIScrollView which has an UIImageView in it. I need to be
I have a scroll view which has one UIView inside which contains the content.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.