圆角+阴影:
如果上面的方法一起用,把masksToBounds开了,阴影无法显示,关了的话其上的View又会遮住圆角。解决的方式只能是再加一层layer。
swift版:
shadowoffset: +, + 是右下 -,+是左下 +,-是右上 -,-是左上
这是从xcode里面摘取的内容,苹果的官方文档/** Shadow properties. **/
/* The color of the shadow. Defaults to opaque black. Colors created
* from patterns are currently NOT supported. Animatable. */
@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
其实就是三个属性
后面这个是做的效果图
form http://blog.csdn.net/rhljiayou/article/details/10178723
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)