UITableView has no scrolling

11,246

My checklist in this case:

  • is tableview scrollEnabled == YES?
  • tableView.contentSize.width != tableView.bounds.size.width && tableView.contentSize.height != tableView.bounds.size.height;
  • interface orientation is correct?
  • There aren't any invisibe UIView or subclass over the tableview.
Share:
11,246
fes
Author by

fes

Updated on July 19, 2022

Comments

  • fes
    fes almost 2 years

    I have a UIViewController which uses the UITableViewDelegate and UITableViewDataSource. I have created UITableView with about 20 custom UITableViewCells and not all those UITableViewCells fit on the screen. Naturally you would think that it is possible to scroll to the bottom and see the other UITableViewCells but it doesn't detect the scrolling at all so I can't see the bottom items.

    My AppDelegate has a UINavigationController and I just added it with

    [window addSubview:navigationController.view]

    The View Controller inside the Navigation Controller implements a

    @interface MainViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>
    

    All I am simply doing is creating a UINavigationController application so by default the UITableView properties should be the default ones.

    My MainViewController XIB has

    • View
      • Table View
      • Table View Cell
      • Table View Cell
      • Table View Cell
      • another 15 Table View Cell

    From the above I'm not sure how I've modified the default UITableView as I have not configured it in any way.

    The UITableView renders as I want it to, but when I want to see the bottom UITableViewCells it just doesn't scroll at all.

  • fes
    fes about 13 years
    how do I check these properties without using XIB's?
  • fes
    fes about 13 years
    after checking some of the width's and height's of the UIView & UITableView, it turns out that either the UITableView was much larger than the UIView so it wasn't scrolling at all.
  • ΩlostA
    ΩlostA over 7 years
    And I had to add that line self.tableView.scrollEnabled = YES because without it, I had to click two times in the cell (only after scrolling).
  • iPhoneDeveloper
    iPhoneDeveloper over 6 years
    Checking scrollEnabled property for tableView helped me :)