1

I'm currently having a CollectionViewController which by clicking on cells will display the detail view controller (TableViewController).

Code for displaying TableVC modally:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *detailVC = [storyboard instantiateViewControllerWithIdentifier:@"DetailTimetableViewController"];

[self presentViewController:detailVC animated:true completion:nil];

Things are working fine with the code above, the Table View Controller is presented modally and the scroll is behaving properly.

However, i followed this tutorial (http://blog.matthewcheok.com/design-teardown-preview-expanding-cells/), which creates a custom UIViewControllerAnimatedTransitioning, I've had everything from the tutorial to be working completely fine.

Code for display TableVC modally (with custom animation):

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *detailVC = [storyboard instantiateViewControllerWithIdentifier:@"DetailTimetableViewController"];

ExpandingCellTransition *transition = [[ExpandingCellTransition alloc]init];
detailVC.transitioningDelegate = transition;

[self presentViewController:detailVC animated:true completion:nil];

However, everything is working fine except for when the TableViewController is presented, it doesn't allows scrolling to the bottom, and is restricted at certain height.

I've tried searching for similar problems (TableViewController unable to scroll to bottom), and tried applying their solutions but none of it works, I believe the cause of problem to be from the custom transition delegate.

Daryl
  • 86
  • 1
  • 7
  • check your table view controller constraint in storyboard – Moin Shirazi Mar 22 '16 at 07:24
  • I've tried to add constraints on Table View Controller, but was unable to do so, the constraints form is blank. Same scenario with (http://stackoverflow.com/questions/21182226/unable-to-use-autolayout-constraints-in-a-tableview). Thanks anyway :D – Daryl Mar 22 '16 at 08:07
  • Try out this http://stackoverflow.com/questions/29804323/xcode-adding-constraints-to-uitableview-so-that-it-fits-all-screen-sizes – Moin Shirazi Mar 22 '16 at 09:04

4 Answers4

0

Try this

// Obj-C
self.automaticallyAdjustsScrollViewInsets = NO;

// Swift
self.automaticallyAdjustsScrollViewInsets = false

hope may help you

Luca D'Alberti
  • 4,749
  • 3
  • 25
  • 45
  • Tried implementing in viewDidLoad of my Table View Controller and also tried setting it in CollectionViewController before presentViewController method, wasn't working, thanks anyway. – Daryl Mar 22 '16 at 15:06
0

In the MainViewController viewDidLoad method, add the following code: self.automaticallyAdjustsScrollViewInsets= NO

Dovydas Šopa
  • 2,282
  • 8
  • 26
  • 34
ChildrenGreens
  • 119
  • 1
  • 9
0

set tableviewProperty tableview.UITableViewAutomaticDimension = YES

Saood
  • 273
  • 1
  • 3
  • 17
  • I'm unsure how to implement your answer, but after searching, I found it to be related to auto-resizing the cell, though I believe my problem to be caused by height problem of Table View, thanks. – Daryl Mar 22 '16 at 15:12
  • use auto layout in cell and set property mentioned in answer – Saood Mar 23 '16 at 05:29
0
use following code in cellForrowAtindexPath delegate method:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];

    // Configure the cell...

    return cell;
}
S.Govind
  • 61
  • 9
  • I believe the problem to be height of the Table View, not with the cell within, thanks. – Daryl Mar 22 '16 at 15:08