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

  • Home
  • SEARCH
  • 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 6705583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:25:14+00:00 2026-05-26T07:25:14+00:00

I am using a uiscrollview to display an UIImageview that is larger then screen

  • 0

I am using a uiscrollview to display an UIImageview that is larger then screen size (just like photo viewing in the Photo Library). next i needed to add a point (i am using a UIImageview to show a dot) to the screen when the user taps. got that working.

now what i am trying to do is have that point to stay in the same location relative to the image. UIScrollview has some notifications for when dragging starts and ends, but nothing that gives a constant update of its contentoffset. say i place a dot at X location. i then scroll down 50 pixels, the point needs to move up 50 pixels smoothly (so the point always stays at the same location relative to the image).

does anybody have any ideas?

EDIT: adding code

- (void)viewDidLoad
{
    [super viewDidLoad];
    //other code...
    scrollView.delegate = self;
    scrollView.clipsToBounds = YES;
    scrollView.decelerationRate = UIScrollViewDecelerationRateFast;
    scrollView.minimumZoomScale = (scrollView.frame.size.width  / imageView.frame.size.width);
    scrollView.maximumZoomScale = 10.0;    
    //other code...
}

adding a point

-(void) foundTap:(UITapGestureRecognizer *) recognizer
{
    CGPoint pixelPos = [recognizer locationInView:self.view];

    UIImageView *testPoint = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"inner-circle.png"]];
    testPoint.frame = CGRectMake(0, 0, 20, 20);
    testPoint.center = CGPointMake(pixelPos.x, pixelPos.y);
    [self.scrollView addSubview:testPoint];

    NSMutableArray *tempTestPointArray = [[NSMutableArray alloc] initWithArray:testPointArray];
    [tempTestPointArray addObject:testPoint];
    testPointArray = tempTestPointArray;

    NSLog(@"recorded point %f,%f",pixelPos.x,pixelPos.y);
}

getting pixel points

-(void)scrollViewDidZoom:(UIScrollView *)scrollView
{
    NSLog(@"zoom factor: %f", scrollView.zoomScale);
    UIPinchGestureRecognizer *test = scrollView.pinchGestureRecognizer;

    UIView *piece = test.view;
    CGPoint locationInView = [test locationInView:piece];
    CGPoint locationInSuperview = [test locationInView:piece.superview];

    NSLog(@"locationInView: %@ locationInSuperView: %@", NSStringFromCGPoint(locationInView), NSStringFromCGPoint(locationInSuperview));
}
  • 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-05-26T07:25:15+00:00Added an answer on May 26, 2026 at 7:25 am

    You can implement the UIScrollViewDelegate method scrollViewDidScroll: to get a continuous callback whenever the content offset changes.

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

Sidebar

Related Questions

i want to display image in UIImageView which is on the UIScrollView and using
I have a UIView that I'm sliding in using a UIScrollView. Code looks like
I have a UIScrollView which I create and size dynamically using... scrollView.contentSize = CGSizeMake(scrollView.frame.size.width
I'm developing an application to display a gallery of UIImages by using a UIScrollView
I have a UIScrollView with a custom content view that uses drawRect to display
I'm using an UIScrollView and I have an image that indicates to the user
I have a UIScrollView that holds UIImageViews. I'd like to animate the transition between
I'm trying to implement zooming functionality using a UIScrollView in MonoTouch but I just
I'm using a UIScrollView to display a custom UIView . When the user drags
I have a UIScrollView with pagingEnabled on and I want to (using like a

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.