2

So, this is my view:

enter image description here

and this is my UItableViewDelegate and DataSource

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"course"];
    cell.textLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10];
    cell.detailTextLabel.text = [NSString stringWithFormat:@"%i" ,arc4random() % 10];
    return cell;
}

And this is the result:

enter image description here

The problem is that the UItableView doesn't scroll. never. I really can't figure out why... Someone can help me?

Vincent Bernier
  • 8,674
  • 4
  • 35
  • 40
Marco Manzoni
  • 707
  • 3
  • 11
  • 21
  • The header image (clocks) that you have show in the results, how are you implementing that? is it covering the tableview? – mkral Dec 05 '12 at 22:18
  • I implement that programmatically and no, it isn't covering the tableView. – Marco Manzoni Dec 05 '12 at 22:20
  • Well if you are sure that the header UIView's frame you've programmed is not larger than intended and covering the tableview there must be something else going on. Have you done any altering that you think might be the issue? A tableview is a subclass of scrollview so it should work. – mkral Dec 05 '12 at 22:30
  • Have you modified the contentsize somehow? – ott-- Dec 05 '12 at 22:56

3 Answers3

6

I've seen similar thing in and every time I've seen this behaviour it was because some view were capturing the touches.

In clear, check your view Hierarchy to see if a view overlaps your tableView, (even a view with an alpha of 0.05 can recognize and digest touch).

I suggest you take the root view of your controller and to recursively call on the view Hierarchy to NSLog the size of your images.

you can also do this with your tableView :

- (void)bringSubviewToFront:(UIView *)view
[self.view bringSubviewToFront:self.tableView];

If your tableview is scrolling when in front of every thing else, you will know for shure that some view is capturing the touch before the table view.

hypermiler
  • 113
  • 2
  • 4
Vincent Bernier
  • 8,674
  • 4
  • 35
  • 40
  • I had not noticed that the view at the top (the one that allows you to make a horizontal scrolling) was really great the whole view. I resized the view, added the tableView and everything works now! – Marco Manzoni Dec 06 '12 at 10:04
3

I tried to achieve a similar result and it works fine for me. Try to check you options

UITableViewOptions

Gabriele Petronella
  • 106,943
  • 21
  • 217
  • 235
3

Try saying self.tableView.userInteractionEnabled = YES; after you implement the clock view.

If this doesn't work, try [self.view bringSubviewToFront:self.tableView];

Undo
  • 25,519
  • 37
  • 106
  • 129