// //给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;
分享到:
相关推荐
Android ImageView点击选中后添加边框,详细内容可以到我的博客www.heimizhou.com中了解。
圆形,圆角,带边框的圆形imageView,以及白色边框的圆形imageview
RCImageView 自定义圆角ImageView,带边框效果
自定义带边框ImageView
主要为大家详细介绍了Android实现ImageView阴影和图层效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
同google+圆形ImageView,同时带有圆形外边框,和阴影效果。
在项目中用到了一个如下功能:双击自定义imageview控件,然后控件显示一个红色边框,表示该控件处于可编辑状态,再次双击边框消失,控件不可再被编辑。现把双击和画线部分单独摘出来,希望能帮到别人。
带有圆形外边框的ImageView,有阴影效果
简单实现圆形ImageView双层边框
本例是通过自定义imageview实现自动添加水印的,这样不仅简单,而且可以增强代码可读性,就跟使用原生的imageview一样简单哦。
官方说也带旋转和锯齿,很可惜我们有找到相应的属性。项目地址:https://github.com/zhaozhentao/MaterialImageView 效果图:如何使用:由于MaterialImageView是扩展了ImageView,支持ImageView的所有特性。 ...
给图片添加阴影效果,这是很常见的需求。第一种方法是自定义drawable,使用layer-list定义两个图片,代码如下: show_view.xml: <?xml version=1.0 encoding=utf-8?> <layer-list xmlns:android=...
自己做的一个点击imageview加边框和仿京东分类页面,里面还有自定义圆角,纯圆imageview。
实验三 ImageView和Switch的使用
android自定义ImageView,圆角和圆形,抗锯齿.亲测可用。直接拷贝代码就行。
在imageview上的指定位置添加另一个iamgeview,并实现等比例缩放,图片自适应
BadgedImageview allow you show a badge into a Imageview. I just extracted the widgets from Plaid app developed by Nick Butcher(https://github.com/nickbutcher) and add some adjustments, all credits for...
ElevationImageView - 带高程阴影的Imageview