ios - UITableViewCell top shadow is covered by UITableView header view -
i have uitableview custom headerview (added via storyboard). want put drop shadow on first cell in table view. unfortunately, header view covers shadow.
i making shadow in cellforrowatindexpath with:
[cell setclipstobounds:no]; [cell.layer setmaskstobounds:no]; [cell.layer setshadowoffset:cgsizemake(0, 2)]; [cell.layer setshadowcolor:[[uicolor blackcolor] cgcolor]]; [cell.layer setshadowradius:4.0]; [cell.layer setshadowopacity:1.0]; [cell.layer setzposition:10.0];
the shadow appears if set hidden state of header view yes. if header if visible, covers shadow. need shadow display in front of header view.
i have tried:
[self.tableview sendsubviewtoback:self.headerview];
which has no effect.
what's correct way accomplish this? thanks!
setting header view's zposition
negative works me:
- (void)viewdidload { [super viewdidload]; self.tableview.tableheaderview.layer.zposition = -1; }
i didn't need modify view ordering or set zposition
of cells.
Comments
Post a Comment