3

I ran into this very strange bug and have no idea how to fix it after trying all that I know. So if you can help it would be immensely helpful!!!

I have a UIViewController that is hosting a tableView whose dataSource and delegate is the viewController itself. I am using it to present some navigation options, it is being presented with the iOS package ECSlidingViewController.

A screenshot of what it looks like is the following:

enter image description here

Notice that there are only 2 items in the tableView now. But there is actually another item (the first one) that's above these two. However, that one is automatically scrolled up when the view shows up, and if I try to scroll it down, the first item is indeed visible, but the tableView automatically bounces back when I release the scrolling gesture.

I have tried setContentOffset for the tableView, and scrollToRowAtIndexPath in viewWillAppear and none of them works.

The menu items are set as a property of the VC itself in villDidLoad, which looks like this

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.menuItems = [NSArray arrayWithObjects: @"Run Test", @"Test Log", @"About", nil];
    // setup the dataSource and delegate for tableView
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    [self.slidingViewController setAnchorRightRevealAmount:ANCHOR_RIGHT_REVEAL_AMOUNT];
    self.slidingViewController.underLeftWidthLayout = ECFullWidth;
}

As you can see the first item is @"Run Test", which is scrolled off screen automatically for no reason. Thank you very much for your help!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Enzo
  • 969
  • 1
  • 8
  • 23

0 Answers0