First of all, I am new at this and I am most likely forgetting something very simple.
Question:
I am making an application that displays random images from imgur.com in a tableView
. For some reason all of the cells are indented a small amount as seen in the picture below. I have fiddled around with many settings in storyboard
and have had no luck in fixing the issue.
Here is the tableView code...
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
// Return the number of rows in the section.
return (_images.count * 2);
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = nil;
if (indexPath.row % 2 == 0) {
//content cell
cell = [tableView dequeueReusableCellWithIdentifier:@"RandomImgurTableCell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"RandomImgurTableCell"];
}
long row = [indexPath row] / 2;
SDImageCache* myCache = [SDImageCache sharedImageCache];
cell.imageView.image = [myCache imageFromDiskCacheForKey:_images[row]];
}
else if (indexPath.row % 2 == 1) {
//separator cell
cell = [tableView dequeueReusableCellWithIdentifier:@"SeparatorCell"];
if(cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"SeparatorCell"];
}
}
if (indexPath.row == (_images.count * 2) - 3) {
[self checkToLoadMoreImages];
NSLog(@"Hit bottom of table, getting more images");
}
return cell;
}
Here is a picture of my tableView
and cell settings...