UITableViewCell设置内容边框或者圆角边框
ios UITableViewCell设置内容边框或者圆角边框,可以通过自定义视图添加在contentView之上,以达到设置自定义背景的目的,代码如下
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,-1,self.frame.size.width, self.frame.size.height + 1)];
container.clipsToBounds = YES;
container.layer.borderWidth = 1.0f;
container.layer.borderColor = [UIColor colorWithHexString:@"0xe3e3e3"].CGColor;
[self.contentView addSubview:container];