0

I've looked at many solutions for this problem on here, but none of them seem to work for me. Here is some of my code:

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    scrollOffset = scrollView.contentOffset;
    [expansionTableView reloadData];
    // contentSize has now been changed
    [scrollView setContentOffset:scrollOffset animated:YES];

Even though I can see from NSLog statements that the contentOffset has been set correctly at this point, it doesn't display according to the contentOffset. It jumps somewhere else. Why is this happening and how do I fix it?

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
reid55
  • 169
  • 3
  • 14
  • what exactly are you trying to do? – BangOperator Apr 22 '14 at 06:49
  • I'm trying to create functionality like wikipedia's mobile app, where, on a scrollable page, you can click on tabs (e.g., Career) and this causes that tab's content to display. If you click the tab again, the content disappears. – reid55 Apr 22 '14 at 07:33
  • You can implement the above said by imitating the apple table view animation gesture sample. Here is the link. https://developer.apple.com/library/ios/samplecode/TableViewUpdates/Introduction/Intro.html – BangOperator Apr 22 '14 at 10:32
  • Unfortunately, that won't work for me because one of my table entries needs to be UIImageView. – reid55 Apr 22 '14 at 21:34

1 Answers1

-1

From the Docs:

Important: You should not embed UIWebView or UITableView objects in UIScrollView objects. If you do so, unexpected behavior can result because touch events for the two objects can be mixed up and wrongly handled.

Segev
  • 19,035
  • 12
  • 80
  • 152