Reputation: 145
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.
Upvotes: 0
Views: 1433
Reputation: 12908
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]];
}
Upvotes: 2
Reputation: 2398
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
Upvotes: 1