Мне нужно поместить два изображения в iOS tableview.Несколько изображений на UITableView
Я использовал этот код, чтобы вставить изображение в ячейке:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
UIImage *cellImage = [UIImage imageNamed:@"verde_diversos.png"];
cell.imageView.image = cellImage;
cell.textLabel.text = [self.colorNames objectAtIndex: [indexPath row]];
return cell;
}
Помощь?
Эта работа! Спасибо всем –
, если вы добавите UIImageView в 'cell.contentView', я подниму вас. Subviews ячейки должны перейти в contentView, так что растяжение/сжатие (например, когда вы добавляете аксессуар) ячейки работает правильно –
@MatthiasBauch конечно – NeverBe