UITableView的一部分周围的阴影 [英] Shadow around a section of UITableView

查看:77
本文介绍了UITableView的一部分周围的阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含4个部分的UITableView.现在,我想向表的特定部分而不是整个表添加阴影效果.我该如何完成这项任务?

I have a UITableView with 4 sections. Now I want to add a shadow effect to a particular section of table but not the full table. How can I achieve this task?

推荐答案

尝试一下

yourView.layer.shadowColor = [[UIColor blackColor] CGColor];
yourView.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);
yourView.layer.shadowRadius = 3.0f;
yourView.layer.shadowOpacity = 1.0f; 

您需要将"yourView"替换为其他内容

You'll need to replace "yourView" with anything else

别忘了,您还需要导入QuartzCore/CALayer.h

don't forget also you'll need import QuartzCore/CALayer.h

这篇关于UITableView的一部分周围的阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆