How to corner radius only top left and top right of table view custom cell .I write following code and it working fine on iphone 6, 5,7 . but on Iphone 6+, 7+ it look like given screen.
My code is ----
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CustomeCell"];
if (indexPath.row == 0) {
UIBezierPath *maskPath = [UIBezierPath
bezierPathWithRoundedRect:cell.contantsView.bounds
byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight)
cornerRadii:CGSizeMake(4, 4)
];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = cell.bounds;
maskLayer.path = maskPath.CGPath;
cell.contantsView.layer.mask = maskLayer;
cell.contantsView.layer.masksToBounds = YES;
}
return cell;
}
it this screen I corner radius of only first and last cell . Center cell are look fine . I want to look all cells width same .