UITableView does not show scrolling

advertisements

I am populating table view in view appeared event, and calling reloadData of tableview. Table fills up with some rows but does not show scrolling for more rows. I am a fresher in iOS development. What can be wrong?


Try the following code

- (void)viewDidLoad {
    //write the code to fetch and store the data in array(table view data source)
    [self.tableView setFrame:self.view.bounds];//the frame should not exceed self.view.bounds, try `NSLog(@"View Bounds %@",NSStringFromCGRect(self.view.bounds));` to know view bounds
    [self.tableView setScrollEnabled:YES];
    [self.tableView setShowsHorizontalScrollIndicator:YES];
    [self.tableView setShowsVerticalScrollIndicator:YES];
    dispatch_async(dispatch_get_main_queue(), ^{
        [self.tableView reloadData];
     });
}

replace self.tableView with your table name.

Hope this helps.