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 9030995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:37:34+00:00 2026-06-16T07:37:34+00:00

I am trying to use a UIScrollView as a navigation device in my iOS

  • 0

I am trying to use a UIScrollView as a navigation device in my iOS application. Basically, I want the application to load specific content, based on the position of a paging-enabled UIScrollView. It is sort of like a navigation wheel.

Currently, I have a two-page (2*320) scrollview, and I am using the scrollViewDidEndDragging delegate method and contentoffset.x to load the appropriate content. I try to determine the position of the scrollview as such:

if (scrollView.contentOffset.x < 320) {
   // Load content 1
    }
else if (scrollView.contentOffset.x >= 320) {
   // Load content 2
    }

My problem is that I either do not understand how to work with contentoffset or it is not suitable to deal with my problem. Either way, I am stuck. Can someone let me know where I went wrong and/or show me a more efficient way to determine scrollview position?

I am stupid, I forgot to mention what the problem is… Basically, I cannot track the position of the scrollview. When I move to the second page it only registers changes if I go over the 620 limit (bounce rightward). But when I go back to the starting position (page 1), it does register the changes. In other words, my tracking is not accurate.

Delegate and everything else is working fine, I log them!

  • 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-16T07:37:36+00:00Added an answer on June 16, 2026 at 7:37 am

    It’s hard to say because you never specifically mentioned what the problem is, but I’ll take a couple guesses at it.

    If the delegate method isn’t being called at all you need to remember to set the scroll views delegate:

    [myScrollView setDelegate:self];

    Otherwise, the problem with using scrollViewDidEndDragging to detect the scroll views offset is that it will check the offset at the point where you stop dragging which could be within the destination pages rect, or within the starting pages rect. As an alternative, I’d suggest you use scrollViewDidEndDecelerating to check the content offset as it will be called as soon as the scroll view comes to a stop at its destination page.

    -(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
        if (scrollView.contentOffset.x < 320) {
            NSLog(@"%@",NSStringFromCGPoint(scrollView.contentOffset));
        }
        else if (scrollView.contentOffset.x >= 320) {
            NSLog(@"%@",NSStringFromCGPoint(scrollView.contentOffset));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a UIScrollView as the content view into a PageViewController, I've
I am trying use gem tire to search in my application. I have tables
Trying to use Powershell to script the removal of specific custom errors from an
I'm trying to use a UIWebView for displaying content higher than the screen of
I am trying use an if statement and TWO .addClass background-color variables based on
I am trying to use a UIPageControl with my UIScrollView. It seems that i'm
i'm trying use webview to load a image from sdcard i use this path
I'm trying to use a UIScrollView as a UITextView, except it will have a
I'm trying to make an iOS app. As part of the app, I want
I'm trying use a UIScrollview inclined 350 degrees, the first thing I thought was

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.