Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Nested UIScrollViews Not Responding
    primarykey
    data
    text
    <p>I've been searching around on how to nest UIScrollViews. It seems like it should be as easy as adding the inner scroll views by using addSubview: of the container scroll view. I have everything showing up visually correct but the functionality of the inner scroll views is non existent despite supplying them with proper frames and content sizes. My code below shows what I have so far. Only the outer scroll view scrolls. I want it so that the outer scroll view controls left to right scrolling and each inner scroll view controls vertical scrolling of their related page content.</p> <pre><code>self.containerScroll = [[UIScrollView alloc]init]; self.containerScroll.frame = CGRectMake(0,(self.headerView.frame.size.height + self.pageControl.frame.size.height),screenWidth, (screenHeight - (self.headerView.frame.size.height + self.pageControl.frame.size.height))); self.containerScroll.backgroundColor = [UIColor clearColor]; self.containerScroll.alpha = 1; self.containerScroll.pagingEnabled = YES; self.containerScroll.contentSize = CGSizeMake(self.containerScroll.bounds.size.width*3,1); self.containerScroll.bounces = NO; self.containerScroll.delegate = self; [self.view addSubview:self.containerScroll]; self.page1Scroll = [[UIScrollView alloc]init]; self.page1Scroll.frame = CGRectMake(0,0,self.containerScroll.bounds.size.width,self.containerScroll.bounds.size.height); self.page1Scroll.backgroundColor = [UIColor redColor]; self.page1Scroll.alpha = 1; [self.page1Scroll addSubview:self.feedPageVC.view]; self.page1Scroll.contentSize = CGSizeMake(320,500); self.page1Scroll.delegate = self; [self.containerScroll addSubview:self.page1Scroll]; self.page2Scroll = [[UIScrollView alloc]init]; self.page2Scroll.frame = CGRectMake(self.containerScroll.bounds.size.width,0,self.containerScroll.bounds.size.width,self.containerScroll.bounds.size.height); self.page2Scroll.backgroundColor = [UIColor greenColor]; self.page2Scroll.delegate = self; [self.containerScroll addSubview:self.page2Scroll]; self.page3Scroll = [[UIScrollView alloc]init]; self.page3Scroll.frame = CGRectMake(self.containerScroll.bounds.size.width*2,0,self.containerScroll.bounds.size.width,self.containerScroll.bounds.size.height); self.page3Scroll.backgroundColor = [UIColor blueColor]; [self.page3Scroll addSubview:self.detailsPageVC.view]; self.page3Scroll.contentSize = CGSizeMake(320,500); self.page3Scroll.delegate = self; [self.containerScroll addSubview:self.page3Scroll]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload