首页 > 代码库 > imageView添加阴影和边框

imageView添加阴影和边框

技术分享

 

注意:大量设置阴影会造成卡顿!!!

用上这句之后流畅度大大增加:imageV.layer.shouldRasterize = YES;

例:

        // 设置阴影

        imageV.layer.shadowOffset = CGSizeMake(4, 0);

        imageV.layer.shadowColor = [UIColor blackColor].CGColor;

        imageV.layer.shadowOpacity = 0.6;

        imageV.layer.shadowRadius = 3;

        imageV.layer.shouldRasterize = YES;

imageView添加阴影和边框