TomThorpe / UIScrollSlidingPages

Allows you to add multiple view controllers and have them scroll horizontally, with a header scroller that stays in sync with the content and shows next, current and previous items. A zoom out effect appears as you scroll between pages. Similar in style to the Groupon app.
MIT License
913 stars 144 forks source link

Content ViewControllers Height #32

Open pventura1976 opened 10 years ago

pventura1976 commented 10 years ago

Hi,

I don't know if this happens in other cases but when using with StoryBoard, NavigationViewController and reusing previous tableView controllers the content view is not resized properly, causing the last row of the table view be cut-off.

This is how I solved it:

- (TTSlidingPage *) pageForSlidingPagesViewController:(TTScrollSlidingPagesController*)source atIndex:(int)index {

    UIViewController *viewController;
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    // Instantiate content view controllers

    storyboard = nil;

    // Adjust content view controller height
    viewController.view.frame = CGRectMake(_slider.view.frame.origin.x,
                                               _slider.view.frame.origin.y,
                                               _slider.view.frame.size.width,
                                               _slider.view.frame.size.height - _slider.titleScrollerHeight);

    return [[TTSlidingPage alloc] initWithContentViewController:viewController];

}

Best.