I need to build an Airbnb-like table index for displaying real estate, for which I customised a prototype UITableViewCell with a height of 200 and two custom Labels (created using Storyboard) and a background image (added programmatically). All this was laid over a TableViewController added using Storyboard.
The data is being fetched from a JSON file and contains 10 items. But in the iPhone simulator (4-inch),
a) It won't scroll beyond the first three items. I can see only the top half of the third item. How do I make it scroll all the 10 items right to the bottom of the last item?
b) The table overlaps the top iPhone status bar (with battery and network status). The storyboard doesn't allow resizing of the TableView to exclude any padding from the top or bottom. How can I leave some padding from the top and the bottom of the table?
Here is my cellForRowAtIndexPath from MainViewcontroller.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
RealEstateTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
RealEstate *estates = [self.allEstate objectAtIndex:indexPath.row];
[self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleSingleLineEtched];
cell.titleLabel.text=estates.title;
cell.infoLabel.text=[NSString stringWithFormat:@"%@ | %@",[properties formattedDate], [estates organiser]];
NSURL *url = [NSURL URLWithString:estates.photoURL];
NSData *data =[NSData dataWithContentsOfURL:url];
UIImage *img=[UIImage imageWithData:data];
[cell.backgroundView setContentMode:UIViewContentModeScaleAspectFill];
cell.backgroundView = [[UIImageView alloc] initWithImage:img];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:img];
return cell;
}