@property(nullable) CGColorRef shadowColor;

/* The opacity of the shadow. Defaults to 0. Specifying a value outside the
* [0,1] range will give undefined results. Animatable. */ @property float shadowOpacity; /* The shadow offset. Defaults to (0, -3). Animatable. */ @property CGSize shadowOffset; /* The blur radius used to create the shadow. Defaults to 3. Animatable. */ @property CGFloat shadowRadius; /* When non-null this path defines the outline used to construct the
* layer's shadow instead of using the layer's composited alpha
* channel. The path is rendered using the non-zero winding rule.
* Specifying the path explicitly using this property will usually
* improve rendering performance, as will sharing the same path
* reference across multiple layers. Upon assignment the path is copied.
* Defaults to null. Animatable. */ @property(nullable) CGPathRef shadowPath;

1、shadowColor:阴影颜色

2、shadowOpacity:不透明度,取值范围[0,1],可以对应UIView的 透明度 进行理解
3、shadowRadius:对阴影的模糊度,默认值为3 ,值越大,越模糊,越自然如果为零则有明确的边界线

4、shadowOffset:阴影的偏移量,默认(0,-3)

5、shadowPath:可以指定阴影的形状,可以矩形,圆形甚至是贝塞尔曲线生成的任意形状,如下代码,生成的就是矩形的阴影

CGFloat x,y,w,h;
CGMutablePathRef squarePath = CGPathCreateMutable();
CGPathAddRect(squarePath, NULL, CGRectMake(x, y, w, h));
view.layer.shadowPath = squarePath;

相同

IOS CALayer的阴影属性的更多相关文章

  1. IOS CALayer的属性和使用

    一.CALayer的常用属性 1.@propertyCGPoint position; 图层中心点的位置,类似与UIView的center:用来设置CALayer在父层中的位置:以父层的左上角为原点( ...

  2. iOS开发UI篇—CAlayer层的属性

    iOS开发UI篇—CAlayer层的属性 一.position和anchorPoint 1.简单介绍 CALayer有2个非常重要的属性:position和anchorPoint @property ...

  3. iOS开发UI 篇—CAlayer层的属性

    一.position和anchorPoint 1.简单介绍 CALayer有2个非常重要的属性:position和anchorPoint @property CGPoint position; 用来设 ...

  4. iOS CALayer使用

    CALayer使用 iOS的设备中,我们之所以能看到各种各样的控件.文字.图片,都是Core Animation框架的功劳.它通过图层的合成,最终显示在屏幕上.而今天这篇文章讲的就是Core Anim ...

  5. CAlayer层的属性

    iOS开发UI篇—CAlayer层的属性 一.position和anchorPoint 1.简单介绍 CALayer有2个非常重要的属性:position和anchorPoint @property ...

  6. CALayer的additive属性解析

    CALayer的additive属性解析 效果: 源码:https://github.com/RylanJIN/ShareOfCoreAnimation // // CAPartAViewContro ...

  7. Pop–实现任意iOS对象的任意属性的动态变化

    简介 Pop 是一个可扩展的动画引擎,可用于实现任意iOS对象的任意属性的动态变化,支持一般动画,弹性动画和渐变动画三种类型. 项目主页: pop 最新示例: 点击下载 注意: 官方代码中,并不包含实 ...

  8. iOS CALayer总结——图层几何

    最近看了一下关于图层和动画的内容,所以写了一份总结,算是对这些内容的汇总吧,都是一些简单的基础知识,不知道大家都了不了解. 除了和用户的交互之外,图层的很多属性和视图基本上都是一样的,今天就先从CAL ...

  9. iOS CALayer 简单介绍

    https://www.jianshu.com/p/09f4e36afd66 什么是CALayer: 总结:能看到的都是uiview,uiview能显示在屏幕上是因为它内部的一个层calyer层. 在 ...

随机推荐

  1. 提高Baidu Map聚合的效率

    百度的MAP的例子里提供了一个聚合效果,地址是http://developer.baidu.com/map/jsdemo.htm#c1_4 ,效果图如下图: 这个效果很赞,但效率很低,当数据量达到50 ...

  2. java、Android SDK、adb环境变量配置,以及JDK1.7换JDK1.8

    最近因项目需要使用将JDK1.7换成JDK1.8,故重新清晰地记录各种环境变量的配置: 这里更改的均是系统变量,不是用户变量 java环境变量配置: 变量名               变量值JAVA ...

  3. cloudera learning2:HDFS

    存入HDFS的文件会按块(block)划分,默认每块128MB.默认1个block还有2个备份.备份增加了数据的可靠性和提高计算效率(数据本地化). HDFS部署可选择不支持HA,也可选择支持HA. ...

  4. css中很有用的属性

    有些css属性很实用,但不常用也就被忘记. 这里纪录了自己在项目中用过的一些. html,body{ -webkit-tap-highlight-color:transparent; } 这个的用途是 ...

  5. anjularjs常用的内置方法

    1.$apply anjularjs通过$apply方法去执行脏检查,及时告诉model绑定变量更新. 示例:定义一个date变量显示在页面上,它的控制器是firstCtrl,这个date变量有一个时 ...

  6. jsp中的form表单中的 id和name有什么区别了

    <form action="./system/WebServer_webServerLogin" method="post" id="login ...

  7. 28个Unix/Linux的命令行神器_转

    28个Unix/Linux的命令行神器 下面是Kristóf Kovács收集的28个Unix/Linux下的28个命令行下的工具,有一些是大家熟悉的,有一些是非常有用的,有一些是不为人知的.这些工具 ...

  8. centos7 搭建GlusterFS

    centos7 搭建GlusterFS 转载http://zhaijunming5.blog.51cto.com/10668883/1704535 实验需求:4台机器安装GlusterFS组成一个集群 ...

  9. Programming paradigms

    https://en.wikipedia.org/wiki/Aspect-oriented_programming Action Agent-oriented Array-oriented Autom ...

  10. leetcode 419

    题目说明: Given an 2D board, count how many different battleships are in it. The battleships are represe ...