如何在iPhone中删除阴影 [英] How can I remove a shadow in iPhone

查看:163
本文介绍了如何在iPhone中删除阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用标准的方式从一个按钮编程阴影,但我想阴影不再存在,当我完成了按钮。我可以设置不透明度为0,但是阴影仍然存在,如果是这样,它仍然税系统。感谢



这会产生错误

  tempButton.superview.layer。 shadowOffset = nil; 
tempButton.superview.layer.shadowRadius = nil;
tempButton.superview.layer.shadowOpacity = nil;


解决方案

我通常执行以下操作以确保安全。 p>

  [[tempButton layer] setShadowOpacity:0.0]; 
[[tempButton layer] setShadowRadius:0.0];
[[tempButton layer] setShadowColor:nil];

Quartz是高度优化的,不会浪费任何时间渲染,如果不必。 p>

I am using the standard way of making shadows from a button programmatically, but I would like to shadow to no longer exist after I am done with the button. I could set opacity to 0, but would the shadow still exist and if so would it still tax the system. thanks

this gives an error

tempButton.superview.layer.shadowOffset = nil;
    tempButton.superview.layer.shadowRadius = nil;
    tempButton.superview.layer.shadowOpacity = nil;

解决方案

I usually do the following to be safe.

  [[tempButton layer] setShadowOpacity:0.0];
  [[tempButton layer] setShadowRadius:0.0];
  [[tempButton layer] setShadowColor:nil];

Quartz is highly optimized and will not waste any time rendering if it doesn't have to.

这篇关于如何在iPhone中删除阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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