Question

I want to make my tableViewCell with rounded corner. It is work fine upto iOS6. But in iOS7 rounded corners are not shown.

I used

((UIView*)[self viewWithTag:200]).layer.cornerRadius = 8;    
((UIView*)[self viewWithTag:200]).layer.masksToBounds = YES;

Please help me. Thanks.

Was it helpful?

Solution

Try this category. For me it is working for all iOS.

- (void)setRoundedBorder:(float) radius borderWidth:(float)borderWidth color:(UIColor*)color
{
    CALayer * l = [self layer];
    [l setMasksToBounds:YES];
    [l setCornerRadius:radius];
    // You can even add a border
    [l setBorderWidth:borderWidth];
    [l setBorderColor:[color CGColor]];
}

OTHER TIPS

iOS 7 does not support rounded corners in grouped tables anymore.

iOS 7 is a major overhaul of the whole GUI. Many things have changed, including the appearance of the UITableViews.

You can try to create a custom cell which draws a rounded rect. You have to identifiy the first and last cell in your TableView and only draw the custom View, Background, whatever for those cells.

Here is a link that may help you, although it is targeted for iOS 6:

changing corner radius of uitableview grouped in iOS6

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