Попытка создать сгруппированное представление таблицы с прозрачными ячейками без каких-либо границ. Цвет фона Tableview сверху донизу становится темнее и легче.IOS сгруппированные прозрачные ячейки tableview
, но как-то настольные ячейки отражают только верхнюю часть фонового изображения, которое темнее.
Я пробовал тонны ответов из stackoverflow, но ни один из них не работает и не смог найти решение этой проблемы.
Что это должно выглядеть следующим образом:
Что это выглядит как с моим кодом:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView setBackgroundView:nil];
self.tableView.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"menu_background.png"]];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.backgroundColor=[UIColor clearColor];
cell.backgroundView=[[UIView alloc] initWithFrame:CGRectZero];
// UIView *backView = [[UIView alloc] initWithFrame:CGRectZero];
// backView.backgroundColor = [UIColor clearColor];
// cell.backgroundView = backView;
// [[cell contentView] setBackgroundColor:[UIColor clearColor]];
// [[cell backgroundView] setBackgroundColor:[UIColor clearColor]];
// [cell setBackgroundColor:[UIColor clearColor]];
// cell.backgroundColor = [UIColor clearColor];
// cell.backgroundView.backgroundColor = [UIColor clearColor];
// cell.contentView.backgroundColor = [UIColor clearColor];
// cell.backgroundColor = [UIColor clearColor];
// UIView *bgView = [[UIView alloc] init];
// [[bgView layer] setCornerRadius:10.0f];
// [bgView setBackgroundColor:[UIColor colorWithWhite:1.0f alpha:0.25f]];
// cell.backgroundView = bgView;
//
return cell;
}
Что мне не хватает? Какое решение для этого?
Спасибо, Space
где ваши изображения? –
@NishantTyagi Я без проблем вижу изображения –
add yourtable.backgroundView = nil; в вашем делетете метод cellForRowAtIndexPath. и я говорю о изображениях, которые вы приложили в своем вопросе. –