Reputation: 462
Right now I am using this piece of code:
donorButton.layer.shadowColor = UIColor.red
donorButton.layer.shadowOffset = CGSize(width: 0, height: 2)
donorButton.layer.shadowRadius = 2
donorButton.layer.shadowOpacity = 1.0
And following is the output, whereas I want to get rid of the shadow on the text
Upvotes: 1
Views: 799
Reputation: 12144
In my opinion, there are 2 solutions for your question.
If you don't care about button background color, just need to change background color of button to non-transparent color.
donorButton.backgroundColor = UIColor.white
If you need a transparent background.
UILabel
below your button and give it same constraints with your button.label.textAlignment = NSTextAlignment.center
Result
Upvotes: 3