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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:44:04+00:00 2026-06-14T09:44:04+00:00

I had made a previous project that used UIScrollView with Paging, but with this

  • 0

I had made a previous project that used UIScrollView with Paging, but with this new project, I have been banging my head over this and can’t get it working. I think the problem may possibly lay with AutoLayout. At first I couldn’t get the paging motion to even work until I realized that all the initialization has to be done in viewDidAppear instead of ViewDidLoad.

Now that I have the action of paging done, the subView don’t load! It will just push the current view I setup in Storyboard out of the way and just shows the blank background.

Note that the code here is almost identical to the my previous project, yet I can’t get the 2nd view (page 2) to show up.

Here is some of the code:

- (void)viewDidAppear:(BOOL)animated{
self.scrollView.delegate = self;
// view controllers are created lazily
// in the meantime, load the array with placeholders which will be replaced on demand
NSMutableArray *controllers = [[NSMutableArray alloc] init];
for (unsigned i = 0; i < kNumberOfPages; i++)
{
    [controllers addObject:[NSNull null]];
}
self.viewControllers = controllers;

// a page is the width of the scroll view
scrollView.pagingEnabled = YES;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, (scrollView.frame.size.height - 50));
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollsToTop = NO;
scrollView.delegate = self;

pageControl.numberOfPages = kNumberOfPages;
pageControl.currentPage = 0;

// pages are created on demand
// load the visible page
// load the page on either side to avoid flashes when the user starts scrolling
//
[self loadScrollViewWithPage:1];
}




- (void)loadScrollViewWithPage:(int)page
{
if (page <= 0)
    return;
if (page >= kNumberOfPages)
    return;

PageOneViewController *controller = [viewControllers objectAtIndex:1];


if ((NSNull *)controller == [NSNull null])
{
    if(page == 1)
    {

        controller = [[PageOneViewController alloc] initWithRequestNumber: @"100" forID:self.idNumberFromLogin];
        [viewControllers replaceObjectAtIndex:page withObject:controller];
        CGRect frame = scrollView.frame;
        frame.origin.x = frame.size.width * 1;
        frame.origin.y = 0;
        controller.view.frame = frame;
        [scrollView addSubview:controller.view];
    }
}

}

In the PageOneViewController

 - (id)initWithRequestNumber:(NSString *)requestID forID: (NSString *) employeeID
{

   if (self = [super initWithNibName:@"OpenRequestCommView" bundle:nil])
   {

   }

   return self;

}
  • 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-14T09:44:06+00:00Added an answer on June 14, 2026 at 9:44 am

    You may have auto layout enabled on your storyboard.

    You can disable auto layout by selecting the file inspector in the storyboard and unchecking “Use Autolayout”.

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

Sidebar

Related Questions

How embarrassing. I had this working on a previous project, but now i am
I have made a jQuery toggle for a menu that I had in mind.
I have been given a project which was released 2+ years ago, and had
I had a previous problem solved on stackoverflow but the requirments of my project
I had made changes in a folder called branch, and now that its working
EDIT: I had made a mistake during the debugging session that lead me to
Upon coding, I realized I had made a mistake. I used git checkout 7e57dbf5a7245...
I Made label to had value from database and linked it . but the
I made changes to some files i had in a project (they were auto
I have made a REST Web service, that works with Visual Studios WCF Test

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.