我已經在表格視圖中爲單元格設置了圖像,但是沒有顯示劃分單元格的行。我做錯了什麼?設置表格視圖單元格圖像
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *mbTableIdentifier = @"SimpleTableItem";
UIImageView *image = [[UIImageView alloc]init];
image.image = [UIImage imageNamed:@"BarButton.png"];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:mbTableIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:mbTableIdentifier];
cell.textLabel.font=[UIFont systemFontOfSize:16.0];
}
// cell.backgroundView = [[CustomCellBackground alloc] init];
cell.selectedBackgroundView = [[CustomCellBackground alloc] init];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.textLabel.highlightedTextColor = [UIColor darkGrayColor];
cell.textLabel.textColor = [UIColor whiteColor];
cell.backgroundView = image;
cell.textLabel.text = [mbTableData objectAtIndex:indexPath.row];
return cell;
}
編輯:我記錄我的分離器的樣式和顏色
2013年5月20日07:28:40.392 KFBNewsroom [1274:C07]電池隔膜風格:2分離器顏色:UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07:28:40.393 KFBNewsroom [1274:c07] cell separator style:2 separator color:UIDeviceRGBColorSpace 0.67 0.67 0.67 1 2013-05-20 07:28:40.393 KFBNewsroom [1274:c07] cell separator風格:2分隔符顏色:UIDeviceRGBColorSpace 0.67 0.67 0.67 1
編輯:問題的屏幕截圖
編輯:我結束了通過添加一個像素線到我的圖像的底部解決問題。
「我設置了圖像fo 「我的表格視圖中的單元格」你是在哪裏做的,我沒有在你的文章中看到它。 – rdelmar
我設置了cell.backgroundView = image; – raginggoat
對不起,錯過了。所以有什麼問題?你看不到那個圖像?目前尚不清楚分界線與你的問題有什麼關係。 – rdelmar