iOS_视图阴影效果的实现

来源:互联网 发布:c语言input函数怎么用 编辑:程序博客网 时间:2024/05/22 17:59

代码部分:

    // 路径阴影    UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:self.callListBottomView.bounds];    self.callListBottomView.layer.shadowColor = [UIColor blackColor].CGColor;    self.callListBottomView.layer.cornerRadius = 5;    self.callListBottomView .layer.masksToBounds = NO;    // 阴影偏移量    self.callListBottomView.layer.shadowOffset = CGSizeMake(10.0f, 10.0f);    // 阴影的透明度    self.callListBottomView.layer.shadowOpacity = 0.8f;    // 设置阴影路径    self.callListBottomView.layer.shadowPath = shadowPath.CGPath;


效果:












原创粉丝点击