如何在UIView的边界之外绘制阴影? [英] How can I draw a shadow beyond a UIView's bounds?

查看:138
本文介绍了如何在UIView的边界之外绘制阴影?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是我如何在UIView下绘制阴影?在视图内容后面绘制阴影。阴影被剪切到视图的边界,虽然我禁用了视图的Interface Builder中的剪辑子视图。是否可以在视图周围绘制阴影 ,而不仅仅是视图中的阴影

I'm using the method described at How do I draw a shadow under a UIView? to draw shadow behind a view's content. The shadow is clipped to the view's bounds, although I disabled "Clip Subviews" in Interface Builder for the view. Is it possible to draw a shadow around a view and not only in a view?

想要在视图内绘制阴影,因为视图将接收阴影区域的触摸事件,这真的属于背景。

I don't want to draw the shadow inside the view because the view would receive touch events for the shadow area, which really belongs to the background.

推荐答案

不鼓励绘制外部视图边界。也许你可以直接包含阴影在你的背景...

It is not encouraged to draw outside view bounds. Maybe you can include the shadow directly in your background...

回想,

这篇关于如何在UIView的边界之外绘制阴影?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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