简体   繁体   中英

iPhone: how can I keep the borders of grouped tableview but set its background to transparent

I use a grouped tableview and custom cells which I load from nib. When I set the background colour of tableview to clearcolor then I can only see the contents of the cells but nothing about the tableview. I like the rounded corners and seperator lines of the gropued view, so I want to keep those lines and change the colours of the lines, but set the table's background colour transparent so I will see the main image of the window. is this possible?

So you wanted to change the color of separator lines

self.tableView.separatorColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1];

// give your hex color code or your color

Inside of viewDidLoad of your view controller you need to set the backgroundView to nil and the backgroundColor to clear.

self.tableview.backgroundView = nil;
self.tableview.backgroundColor = [UIColor clearColor];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM