UITableViewCell设置内容边框或者圆角边框

作者: shaneZhang 分类: ios技术 发布时间: 2015-05-13 17:34

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];

本页面支持繁体中文友好显示:UITableViewCell设置内容边框或者圆角边框

如果觉得我的文章对您有用,请随意打赏。如果有其他问题请联系博主QQ(909491009)或者下方留言!

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注