我已經將UIImage添加到了我的表格視圖單元格中。但是,UIImage正在將分隔符推向右側,爲UIImage騰出空間。我想找到一種方法來讓分隔符包含UIImage,而不是推遲。這是我的表格視圖單元格的圖片。TableViewCell中的UIImage推送單元格分隔符
這裏是我的cellForRowAtIndexPath方法與形象代碼:
-(UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell =
[tableView dequeueReusableCellWithIdentifier:CellIdentifier
forIndexPath:indexPath];
Exercise *tempPlaceholder = [exercisesInTable objectAtIndex:indexPath.row];
NSString *exerciseDisplayName = tempPlaceholder.exerciseName;
exerciseDisplayName = [exerciseDisplayName capitalizedString];
exerciseDisplayName =
[exerciseDisplayName stringByReplacingOccurrencesOfString:@"_"
withString:@" "];
cell.textLabel.text = exerciseDisplayName;
cell.imageView.image = [UIImage imageNamed:@"quads.png"];
return cell;
}
如果有人可以幫助我解決這個我會很感激。謝謝。
看看這個http://stackoverflow.com/questions/18365049/is-there-a-way-to-make-uitableview-cells-in-ios-7-not-have-a-line-break-in-the -s – Infinity
謝謝,完美的工作。 – zic10