开发者

Eliminating the border of a grouped table cell

开发者 https://www.devze.com 2023-01-22 17:25 出处:网络
I have a grouped table view; the table\'s background is a custom image.In one type of cell, I have just an image, and it doesn\'t fill up the entire cell width, and it\'s centered in the cell.

I have a grouped table view; the table's background is a custom image. In one type of cell, I have just an image, and it doesn't fill up the entire cell width, and it's centered in the cell.

I've set that's cell's background to UIColor -clearColor, so that the table's background view shows through, but the cell is still drawing the light gray border (the rounded rectangle outline). I need it to NOT do that!

I've tried setting开发者_StackOverflow中文版 the cell's contentView's background to clear as well, and I've tried setting the table separator style to none, but still the outline draws.

Is it possible to prevent that from drawing?


I never figured this out, but I did use a workaround: I put the image into the footer of the section following the group of "normal" cells. In this case, there is no border, just a custom view, automatically centered in the table. Use the header would have also worked, but I liked the little bit of extra separation that the footer provided.


Have you tried tableView.separatorColor = [UIColor clearColor]; ?

[update] If you want to have a different style for your section headers, you use a custom view by implementing:

– tableView:viewForHeaderInSection:

0

精彩评论

暂无评论...
验证码 换一张
取 消