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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:16:11+00:00 2026-05-23T16:16:11+00:00

My project needs to add and delete a uiwebview to uiscrollview at runtime. Means,

  • 0

My project needs to add and delete a uiwebview to uiscrollview at runtime. Means, when we scroll it horizontally (left or right) when paging is enabled, then a new view get added to the uiscrollview and it traverse to it.

Is it possible to detect the left or right scrolling in uiscrollview?

Plz tell me the best possible solution, sample code or any tutorial.

Thanks in advance

  • 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-23T16:16:12+00:00Added an answer on May 23, 2026 at 4:16 pm

    In such cases, we should have paging enabled in our scroll view.

    Lets say you have scroll view of size 320×480, and it is supposed to show 10 pages, where size of each page is 320×480, making content size of scroll view as 320*10 x 480.

    The best way to determine the current page is by using the content offset value of the scroll view.
    So, in the beginning, when scrollview is showing 1st page, its content offset would be x=0, y=0.

    For 2nd page x=320, y=0.
    Thus we can get the current page value by dividing the contentOffset.x by page-width.
    Thus, 0/320 = 0, means 1st page. 320/320 = 1, means 2nd page, and so on.

    Thus, if we have current page value with us, we can determine in which direction the scroll view is moving, as follows:

    -(void) scrollViewDidScroll:(UIScrollView *)scrollView{
    
        int currentPageOffset = currentPage * PAGE_WIDTH;
        if (self.pageScrollView.contentOffset.x >= currentPageOffset + PAGE_WIDTH) {
            // Scroll in right direction. Reached the next page offset.
            // Settings for loading the next page.
            currentPage = self.pageScrollView.contentOffset.x/PAGE_WIDTH;
        }else if (self.pageScrollView.contentOffset.x <= currentPageOffset - PAGE_WIDTH) {
            // Scroll in left direction. Reached the previous page offset.
            // Setting for loading the previous page.
            currentPage = self.pageScrollView.contentOffset.x/PAGE_WIDTH;
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add CRRedist2008_x86.msi to my deployment project as it is a requirement
I want to use MAF in my project because I need a robust add-in
Could somebody give me a pointer on why I need to add my project
I'm trying to create an NSService in a Bundle project. I need to add
My index.html page for my project needs some Ruby code so I need to
In VS, it's simple. Everything the project needs is stored in the project folder
Every project invariably needs some type of reporting functionality. From a foreach loop in
I have a project that needs to play video but not allow downloading. I'd
I have a Java project that needs a addon interface. I was thinking about
I am making a Python gui project that needs to duplicate the look of

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.