Sanjivani
Sanjivani

Reputation: 273

UITableView does not show scrolling

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

Answers (3)

Saif
Saif

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

lojals
lojals

Reputation: 999

Have you tried scrollEnabled property?

tableViewName.scrollEnabled = true

Upvotes: 0

NSSakly
NSSakly

Reputation: 209

Try to set the frame of your tableView as much as your View

Upvotes: 0

Related Questions