@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. Enum

    1.定义时使用enum关键字定义. 2.隐式继承了java.lang.Enum类,所以不能再继承其他类了. 3.隐式的final修饰符,所以不能被其他类继承. package enumTest; pu ...

  2. Centos防火墙禁止ping和开启ping

    1.允许PING设置 iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT iptables -A OUTPUT -p icmp - ...

  3. Mock之easymock, powermock, and mockito

    easymock, powermock, and mockito Easymock Class Mocking Limitations To be coherent with interface mo ...

  4. Vmware安装Centos NAT方式设置静态IP

    [Vmware中在搭建集群环境等,DHCP自动获取IP方式不方便,为了固定IP减少频繁更改配置信息,建议使用静态IP来配置,网络连接主要有三种方式 1.nat 2.桥接,3主机模式 ,在这里主要介NA ...

  5. yii事件

    控制器: public function actionTests1(){ $c = new \app\components\cat(); $m = new \app\components\mou; $ ...

  6. OC编码问题输出中文

    #import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { ...

  7. visual studio2015从git上clone(克隆)项目

    本文介绍Visual Studio2015从git上clone项目代码的步骤. 1.打开VS2015,进到起始页,打开"团队资源管理器",如下图: 2.点击"克隆&quo ...

  8. 自动重启sqlserver服务

    公司一台官网服务器是由.net语言sqlserver数据库开发的,官网后台登录要涉及到sql数据库,现在出了一个问题,每天登录后台都会报错,要重启sqlserver才能进入,问题一直也没有解决,但是也 ...

  9. gitlab改用ssh操作

    1.配置ssh http://blog.csdn.net/xyzchenxiaolin/article/details/51853319http://blog.csdn.net/r8hzgemq/ar ...

  10. Jquery 定时器 倒计时

    <!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8&qu ...