How can I remove a shadow in iPhone

后端 未结 2 755
囚心锁ツ
囚心锁ツ 2021-02-08 23:18

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

相关标签:
2条回答
  • 2021-02-08 23:51

    I would just remove the button, and replace it with an identical (but non-shadowed) button. Or keep both around and hide/unhide one of them. Sometimes it's easier to create a new UI object than munge around with an existing one.

    0 讨论(0)
  • 2021-02-08 23:59

    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.

    0 讨论(0)
提交回复
热议问题