I've set a transparent image
as the background
for a UIButton
I'm using. It looks perfect, but the problem is the transparent image
is fairly small, so it's not easy for users to click it correctly on their first try.
Here's my code:
optionsButton.setBackgroundImage(UIImage(named: "CalendarEventArrowIcon"), forState: UIControlState.Normal)
optionsButton.addTarget(self, action: "optionsButtonPressed", forControlEvents: UIControlEvents.TouchDown)
Is there a way that I can take the current image I'm using, and place it inside a UIImage with a larger frame, and then make that the background image for the button programmatically
in Swift
?
By doing this, it would make it easier for a user to click the button since the background image would take up a larger area.
Or is the only way for me to actually to do something like this to go back into Photoshop and make the background image
I'm using larger and no longer have a transparent background
?