Reputation: 273
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?
Upvotes: 0
Views: 324
Reputation: 2958
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.
Upvotes: 1
Reputation: 999
Have you tried scrollEnabled property?
tableViewName.scrollEnabled = true
Upvotes: 0