voisvous
voisvous

Reputation: 163

How to make UITableView transparent in IOS7?

I have tried many times and many method to UITableView transparent in IOS7,but it still does not work.I have no any ideas...

"[cell setBackgroundColor:[UIColor clearColor]];"


UIView* bgv = [[UIView alloc] init];
bgv.backgroundColor = [UIColor clearColor];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBackgroundView:bgv];

cell.backgroundColor = [UIColor colorWithRed:(247.0/255.0)
                                 green:(151.0/255.0)  blue:(121.0/255.0) alpha:.3];

All over these 3 method I've tried,still not work.

Can anybody give some more tips about this problem?

Thanks a lot~

Upvotes: 15

Views: 11383

Answers (6)

Ashit Soni
Ashit Soni

Reputation: 226

You have to just clear your TableView cell color. And select tableview background color from property list. Or set tblobj.backgroundcolor...

cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = [UIColor clearColor];

Upvotes: 5

Philip De Vries
Philip De Vries

Reputation: 415

For me, setting the TableViewController class backgroundColor to clearColor programmatically did the trick.

You just need to make sure every single object with a background should have the transparent color. And while I set all of them to transparent in the interface builder, it apparently doesn't always take.

Upvotes: 1

Sandeep Singh
Sandeep Singh

Reputation: 266

Use this

cell.contentView.backgroundColor = [UIColor clearColor];
        cell.backgroundColor = [UIColor clearColor];
        tableView.backgroundColor = [UIColor clearColor];

Upvotes: 16

Moinuddin Girach
Moinuddin Girach

Reputation: 223

set table view background color clear and backgound view nil

[tableView setBackgroundColor:[UIColor clearColor]];
[tableView setBackgroundView:nil];

set cell background color as clear color and cell contentview background color as clear

[cell setBackgroundColor:[UIColor clearColor]];
[cell.contentView setBackgroundColor:[UIColor clearColor]];

This will gives you transparent tableView

Upvotes: 2

Mini
Mini

Reputation: 213

Along with setting table view background color to clear color, you need to set cell.contentview background color to clear color

Upvotes: 0

MeloS
MeloS

Reputation: 7938

Your need to set your tableView's background to clear color, you need a reference to your table view.

Upvotes: 14

Related Questions