设置边框效果和阴影层
来源:互联网 发布:有关小说的软件 编辑:程序博客网 时间:2024/06/08 10:56
边框效果:
//_myImageView边框效果 CALayer *layer = [_myImageView layer]; [layer setCornerRadius:10]; [layer setMasksToBounds:YES];//设置边框可见 layer.borderColor = [[UIColor yellowColor] CGColor]; [layer setBorderWidth:1]; [control addSubview:_myImageView];
阴影层:
CALayer *layer = [imageView layer];layer.shadowOffset = CGSizeMake(0, 3);//[水平偏移,垂直偏移]layer.shadowRadius = 5.0;//阴影半径layer.shadowColor = [UIColor blackColor].CGColor;layer.shadowOpacity = 0.8;//0.0~1.0
逐渐光泽:
CAGradientLayer *gradient = [CAGradientLayer layer];gradient.frame = sampleView.bounds;gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor], (id)[[UIColor grayColor] CGColor], nil]; // 由上到下的漸層顏色[sampleView.layer insertSublayer:gradient atIndex:0];
参考链接:IOS基础_用Core Graphics 绘制阴影图层
Fun shadow effects using custom CALayer shadowPaths
- 设置边框效果和阴影层
- UIView设置边框和阴影
- 为无边框窗口设置阴影效果
- 为View设置边框阴影效果
- css中设置边框阴影效果
- css3阴影设置发光边框效果,阴影按钮
- view 添加边框和阴影效果
- UIView设置圆角、边框和阴影
- iOS 设置UIView的边框和阴影
- UIView设置圆角、边框和阴影
- 设置圆角。边框 和 阴影
- UIView设置圆角、边框和阴影
- UIView设置圆角、边框和阴影
- 边框为阴影效果
- CSS 边框 阴影 效果
- css3边框阴影效果
- QT边框阴影效果
- CSS 边框 阴影 效果
- 【ios】论自定义的控件如何在xib中使用,自定义控件在xib中的初始化入口函数
- 【oracle】oracle 10g 登录em后,提示java.lang.Exception: Exception in sending Request :: null,解决办法
- ACM 每日水题以及小练习 2013年11月5日
- OPENGL|ES第四天,Adding color and shade
- 实现跨域cookie共享
- 设置边框效果和阴影层
- 欢迎到C + +教程
- c语言中指针的15个问题
- 搜索到的解决方法
- IOS判断文件类型
- STL算法概述
- 2.7 《硬啃设计模式》 第9章 创建型设计模式小结
- 轻松搞定面试中的二叉树题目
- Git 入门