y-hryk / YSLContainerViewController

MIT License
304 stars 64 forks source link

menu not response when YSLContainerViewController is inside UIScrollView #15

Open Chren opened 8 years ago

Chren commented 8 years ago

Hi, I have a YSLContainerViewController inside an UIScrollView, when click tab menu, nothing happened, and the Horizontal scroll also not working. How to fix this? Thank you.

vishaldeshai commented 8 years ago

Hello @Chren

i have resloved the issue.

// SetUp ViewControllers PlayListTableViewController *playListVC = [[PlayListTableViewController alloc]initWithNibName:@"PlayListTableViewController" bundle:nil]; playListVC.title = @"PlayList";

ArtistsViewController *artistVC = [[ArtistsViewController alloc]initWithNibName:@"ArtistsViewController" bundle:nil];
artistVC.title = @"Artists";

SampleViewController *sampleVC1 = [[SampleViewController alloc]initWithNibName:@"SampleViewController" bundle:nil];
sampleVC1.title = @"Album";

[self.view layoutSubviews];

[self.scrollView layoutSubviews];

// ContainerView
float initialY = self.headerView.frame.origin.y + self.headerView.frame.size.height;
YSLContainerViewController *containerVC = [[YSLContainerViewController alloc]initWithControllers:@[playListVC,artistVC,sampleVC1]
                                                                                    topBarHeight:0.0
                                                                            parentViewController:self];
containerVC.delegate = self;
containerVC.menuItemFont = [UIFont fontWithName:@"Futura-Medium" size:16];
containerVC.view.backgroundColor = [UIColor greenColor];

containerVC.view.frame = CGRectMake(0.0, initialY, self.contentView.frame.size.width, self.contentView.frame.size.height-initialY-40);

[self.contentView addSubview:containerVC.view];