CALayer介绍
来源:互联网 发布:linux安装软件命令 编辑:程序博客网 时间:2024/05/16 10:11
1、在iOS中,你能看得见摸得着的东西基本上都是UIView,比如一个按钮、一个文本框、一个Label,一个图片等等,这些都是UIView
2、其实UIView之所以能显示在屏幕上,完全是应为它内部的一个图层layer
3、在创建UIView对象时,UIView内部会自动创建一个图层(CALayer),即UIView的layer属性
4、当UIView需要显示到屏幕上时,会调用drawRect方法进行绘图,并且会将所有内容绘制在自己的图层上,绘图完毕后,系统会将图层拷贝到屏幕上,于是就完成了UIView的显示
(绘图上下文是Layer Graphics Context)
5、UIView本身不具备显示功能,是它内部的层才有显示功能
2.1 CALayer的常见属性
@property CGFloat borderWidth;
@property CGColorRef borderColor;
@property CGColorRef backgroundColor; //背景颜色
@property float opacity;//透明度
@property CGColorRef shadowColor; //阴影颜色
@property float shadowOpacity;
@property CGSize shadowOffset;
@property CGFloat shadowRadius;
@property(strong) id contents;
@property CGFloat cornerRadius;
@property CGRect bounds;
@property CGPoint position;
@property CGPoint anchorPoint;
@property CATransform3D transform;
@property(getter=isHidden)BOOL hidden;
@property(readonly) CALayer *superlayer;
@property(copy) NSArray *sublayers;
@property BOOL masksToBounds;
- CALayer介绍
- CALayer介绍
- CALayer 与UIView介绍
- CALayer 详细介绍
- iOS之CALayer介绍
- CAlayer的详细介绍
- CALayer 的属性介绍
- CALayer的介绍
- CALayer属性的简单介绍
- CALayer, CoreGraphics与CABasicAnimation介绍
- IOS开发—CALayer介绍
- IOS进阶 - CALayer简单介绍
- CALayer
- CALayer
- CALayer
- CALayer
- CALayer
- CALayer
- 学习之路
- 编译XX300遇到的问题
- 使用dml语句更改数据
- zabbix的安装和配置
- android intent action 介绍大全
- CALayer介绍
- android webview不能调用JS中的function?
- reboot服务器后访问不到tomcat,要启动nginx
- 安装11.2.0.1的时候执行root.sh报错
- ACM校赛 成功举办后总结
- NSFileManager的常用操作
- 开篇的话
- 安装gi的时候回退root.sh的执行
- spring mvc controller间跳转 重定向 传参