`
修博龙泉
  • 浏览: 314177 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

imageView添加阴影和边框

 
阅读更多
//    //给imageView添加阴影和边框
//    UIImageView*imgvPhoto = [[UIImageView alloc] init];
    //添加边框
    CALayer *layer = [imageView layer];
    layer.borderColor = [UIColor whiteColor].CGColor;
    layer.borderWidth = 5.0f;
    //添加四个边阴影
    imageView.layer.shadowColor = [UIColor blackColor].CGColor;
    imageView.layer.shadowOffset = CGSizeMake(0,0);
    imageView.layer.shadowOpacity = 0.5;
    imageView.layer.shadowRadius = 10.0;//给imageview添加阴影和边框
    //添加两个边的阴影
    imageView.layer.shadowColor = [UIColor blackColor].CGColor;
    imageView.layer.shadowOffset = CGSizeMake(4,4);
    imageView.layer.shadowOpacity = 0.5;
    imageView.layer.shadowRadius=2.0;
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics