Я использую код ниже в моем контроллере вида, но фоновое изображение не отображается.Есть идеи, в чем может быть проблема?
(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-background.png"]]; /* I also tried: cell.backgroundView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-background.png"]]; */ }
Спасибо за помощь,
Стефан
UIImageView * theImageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @ "someImage.png"]; [theImageView setFrame: SomeRect]; [[cell contentView] setBackgroundView: theImageView]; [релиз theImageView];
Это сработает.
Съемка в темноте, но вы пробовали
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell-bacground.png"]];
или, возможно, вы ошиблись фоном в пути изображения? ; -)