tableviewCell 自定义圆角矩形周围有模糊的边界?

iOS 码拜 9年前 (2015-11-25) 865次浏览
tableviewCell 自定义圆角矩形周围有模糊的边界?
自定义的tableViewCell,代码如下;
– (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
UIImageView *imageView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@”xianggang1″]];
imageView.layer.masksToBounds=YES;
imageView.layer.cornerRadius=188/9.0f; //设置为图片宽度的一半出来为圆形
imageView.layer.borderWidth=5.0f; //边框宽度
imageView.layer.borderColor=[[UIColor whiteColor] CGColor];//边框颜色
self.backgroundView = imageView;//[UIImage imageNamed:@”xianggang1″];
return self;
}
发现显示的图片周围有模糊的边界,问一下下这是怎么回事?
解决方案:10分
00:40:46 的提问, 厉害呀;
不使用cell.backgroundView, 而是往cell.contentView中加, 有试过没?
解决方案:20分
自定义cell一般都是加在contentview中,否则可能出现各种问题

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明tableviewCell 自定义圆角矩形周围有模糊的边界?
喜欢 (0)
[1034331897@qq.com]
分享 (0)