【发布时间】:2014-02-16 20:26:56
【问题描述】:
我已将 UIImage 添加到我的表格视图单元格中。但是,UIImage 将分隔符推到右侧,以便为 UIImage 腾出空间。我想找到一种方法让分隔符包含 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;
}
如果有人能帮我解决这个问题,我将不胜感激。谢谢。
【问题讨论】:
-
谢谢,效果很好。
标签: ios objective-c uitableview