[英]UIButton with custom shadow image
I need to achieve effect of my button like this: 我需要这样实现按钮的效果:
My questions are: 我的问题是:
If you want to add the shadow without having it clickable, you need to add an imageView to as a subview to the button. 如果要添加阴影而不使其可单击,则需要将imageView添加为该按钮的子视图。 (make sure clip subviews is disabled). (确保剪辑子视图已禁用)。
If you want the shadow of one button not appearing on top of the other, then you need to have the shadow(s) added separately to the main parent view. 如果您希望一个按钮的阴影不出现在另一个按钮的顶部,则需要将阴影单独添加到主父视图中。 The solution in option 1 will not work. 选项1中的解决方案将不起作用。 Its not neat, but its the only way i can think off. 它不是整洁的,但是它是我可以考虑的唯一方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.