is there a way to not show the rounded corner for the top and bottom cell of each section in grouped UITableView?

StackOverflow https://stackoverflow.com/questions/10166704

Question

I want to instead change them to be straight rectangles and adding a drop shadow on four sides of each section.

Is there a way to do that? I tried the following on each cell, but it seems not work with me.

[cell.layer setCornerRadius:0.0f];
[cell.layer setBorderColor:[UIColor clearColor].CGColor];
[cell.layer setBorderWidth:1.0f];
[cell.layer setShadowColor:[UIColor blackColor].CGColor];
[cell.layer setShadowOpacity:0.4f];
[cell.layer setShadowRadius:0.8f];
[cell.layer setShadowOffset:CGSizeMake(0.8f, 0.8f)];

Anything wrong with my code?

Was it helpful?

Solution

Add two additional rows, one at the top and one at the bottom. Implement heightForCellAtIndexPath: and return 0 height for these cells.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top