I have two UIScrollViews, aScroll and bScroll. And the bScroll is the aScroll's subView. Problem I am facing is, i want to drag in bScroll and do not affect the aScroll. Can someone help me here?? Thanks.
- (void)viewDidLoad
{
[super viewDidLoad];
UIScrollView *aScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(50, 50, 400, 400)];
aScroll.backgroundColor = [UIColor grayColor];
aScroll.contentSize = CGSizeMake(401, 401);
[self.view addSubview:aScroll];
[aScroll release];
UIScrollView *bScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(75, 75, 150, 150)];
bScroll.backgroundColor = [UIColor lightGrayColor];
bScroll.contentSize = CGSizeMake(500, 500);
[aScroll addSubview:bScroll];
[bScroll release];
UILabel *bLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 30, 30)];
bLabel.text = @"B";
[bScroll addSubview:bLabel];
[bLabel release];
UILabel *aLabel = [[UILabel alloc] initWithFrame:CGRectMake(100, 250, 100, 40)];
aLabel.text = @"A";
[aScroll addSubview:aLabel];
[aLabel release];
}