Most of the popular solutions I saw to this problem involved creating a UIImage that is a solid color, as there is a property for setting the background image. And in code, there is no setBackgroundColor(_ color: UIColor?, for state: UIControl.State). ![]() Simple, right? But when I went to do it, I realized there is no option in the storyboard to set the background color of a button for a particular state. It appears as though they are simply animating the background color as well as the font color of the button. I decided that I wanted a button in my app to emulate the look of Appleās buy and update buttons in the app store, which look something like this: ![]() ![]() Recently while working on a project, I stumbled across something that at first glance seemed like it was super simple and would be as easy as setting a property or two.
0 Comments
Leave a Reply. |