1

I've got a UIScrollView (A) parent on the screen, inside it's content I have two controls - another UIScrollView (B) at the Top an an UIView (C) at the bottom,

A is full screen (460px) B 460px but content is longer then the screen (600px) so it has it's scrolling inside C 460px fixed also paging is enabled so B is the 1st page and C is the 2nd,

When I pan down B is scrolling and when it reaches the bottom it's bounces instead of pulling view C, if I set the bounce to NO then it's stuck at the bottom and only if I raise the finger and pan again it pulls the view C..

I saw some related questions but non of them helped me (How to steal touches from UIScrollView?)

a code sample to recreate the situation (or download from my dropbox https://www.dropbox.com/s/f9j0vkg902214ab/Test2.zip)

- (void)viewDidLoad{
[super viewDidLoad];

// create main scroll
UIScrollView *scrollA = [[UIScrollView alloc] initWithFrame:self.view.frame];
scrollA.pagingEnabled = YES;
scrollA.bounces = YES;
[self.view addSubview:scrollA];

// create top scroll B
UIScrollView *scrollB = [[UIScrollView alloc] initWithFrame:self.view.frame];
scrollB.backgroundColor = [UIColor greenColor];
scrollB.bounces = YES;
[scrollA addSubview:scrollB];

// create something to put in B
CGRect frameViewB = scrollB.frame;
frameViewB.origin.x = 30;
frameViewB.size.width = 260;
frameViewB.size.height = 600;
UIView       *viewInsideB = [[UIView alloc] initWithFrame:frameViewB];
viewInsideB.backgroundColor = [UIColor blueColor];
[scrollB addSubview:viewInsideB];
[scrollB setContentSize:viewInsideB.frame.size];

// create bottom view
CGRect frameC = self.view.frame;
frameC.origin.y = 460;
UIView       *viewC = [[UIView alloc] initWithFrame:frameC];
viewC.backgroundColor = [UIColor yellowColor];
[scrollA addSubview:viewC];

// set content for 2 pages
[scrollA setContentSize:CGSizeMake(320, 920)];}

Thanks

Community
  • 1
  • 1
TomerG
  • 13
  • 3

0 Answers0