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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:59:42+00:00 2026-05-29T08:59:42+00:00

I want to make a seamless scrollView The scrollview should have web views as

  • 0

I want to make a seamless scrollView
The scrollview should have web views as its subview
And should scroll Seamlessly

The question is…
I had taken the reference from

http://iosdevelopertips.com/user-interface/creating-circular-and-infinite-uiscrollviews.html#comment-66679

And now I had implemented the seamless scrollview with only 3 pages, but I want the webviews to be in place of label…

  • 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-29T08:59:43+00:00Added an answer on May 29, 2026 at 8:59 am

    Nick
    In the viewDidLoad we have to write the following code.

    - (void)viewDidLoad 
    {
        [super viewDidLoad];
    
        documentTitles = [[NSMutableArray alloc] init];
        arrayWebViews = [[NSMutableArray alloc] init];
    
        // create our array of documents
        for (int i = 0; i < 5; i++) 
        {
            [documentTitles addObject:[NSString stringWithFormat:@"index%i",i]];
        }
    
        // create webviews for the html files
    
        webOne = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)];
        webTwo = [[UIWebView alloc] initWithFrame:CGRectMake(320, 0, 320, 400)];
        webThree = [[UIWebView alloc] initWithFrame:CGRectMake(640, 0, 320, 400)];
    
        // load all three pages into our scroll view
        [self loadPageWithId:2 onPage:0];
        [self loadPageWithId:0 onPage:1];
        [self loadPageWithId:1 onPage:2];
    
        // add them as the subview of scrollview
        [scrollView addSubview:webOne];
        [scrollView addSubview:webTwo];
        [scrollView addSubview:webThree];
    
        // adjust content size for three pages of data and reposition to center page
        scrollView.contentSize = CGSizeMake(960, 400);  
        [scrollView scrollRectToVisible:CGRectMake(320,0,320,400) animated:NO];
    }
    

    Now in the loadPageWithID:andPage: method write the following code

    - (void)loadPageWithId:(int)index onPage:(int)page 
    {
        switch (page) 
        {
            case 0:
                {
                    self.webOne.backgroundColor = [UIColor clearColor];
                    self.webOne.delegate = self;
                    [self.webOne loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]                                                                                              pathForResource:[documentTitles objectAtIndex:index] ofType:@"html"]isDirectory:NO]]];
                    [arrayWebViews addObject:self.webOne];
                }
                break;
    }
    

    Now in the scrollViewDidEndDecelerating write the following code:

    - (void)scrollViewDidEndDecelerating:(UIScrollView *)sender 
    {    
        UIWebView* lobjTempWebView = [arrayWebViews objectAtIndex:0];
    
        for (int indexWebViews = 0; indexWebViews < 2; indexWebViews ++)
        {
            [arrayWebViews replaceObjectAtIndex:indexWebViews withObject:[arrayWebViews objectAtIndex:indexWebViews + 1]];
        }
    
        [arrayWebViews replaceObjectAtIndex:[arrayWebViews count] - 1 withObject:lobjTempWebView];
    
        [[arrayWebViews objectAtIndex:0] setFrame:CGRectMake(0, 0, 320, 400)];
        [[arrayWebViews objectAtIndex:1] setFrame:CGRectMake(320, 0, 320, 400)];
        [[arrayWebViews objectAtIndex:2] setFrame:CGRectMake(640, 0, 320, 400)];
    
        if(scrollView.contentOffset.x > scrollView.frame.size.width) 
        {
    
            currIndex = (currIndex >= [documentTitles count]-1) ? 0 : currIndex + 1;
            nextIndex = (currIndex >= [documentTitles count]-1) ? 0 : currIndex + 1;         
            [[arrayWebViews objectAtIndex:2] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle]                                                                                              pathForResource:[documentTitles objectAtIndex:nextIndex] ofType:@"html"]isDirectory:NO]]];
    
        }     
        // Reset offset back to middle page     
        [scrollView scrollRectToVisible:CGRectMake(320,0,320,400) animated:NO];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have style sheet with a class name changebackgroundcolor i want make change in
i want make a news site gets its content from other news sites, open
I want to make my ASP.Net site authentication seamless using Ajax call. So I
Friends, i want to make a seamless background as a custom view component. the
i have 2 line want make it one line and do the same job
I have an EDI form, I want make it more readable especially the naming
I want make datetimepicker in my project. Using jquery how it is possible? I
Let's say I want make some of my sources publicly available via my blog
I am traversing a HTML document using javascript DOM. I want make a list
I want to make an etag that matches what Apache produces. How does apache

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.