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?

4
  • The header image (clocks) that you have show in the results, how are you implementing that? is it covering the tableview?
    – mkral
    Dec 5, 2012 at 22:18
  • I implement that programmatically and no, it isn't covering the tableView. Dec 5, 2012 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 5, 2012 at 22:30
  • Have you modified the contentsize somehow?
    – ott--
    Dec 5, 2012 at 22:56

3 Answers 3

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.

1
  • 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! Dec 6, 2012 at 10:04
3

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

UITableViewOptions

1
  • I just tried to achieve the same results and my tableview scrolls. Did you change any default options? Dec 5, 2012 at 22:25
3

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.