I'm trying to draw a normal rounded rect UIButton
, but without the border. Ideally I'd like to be able to change some setting on the UIButton
to disable the border.
My problem is that if I change the button type to "custom", I don't get the nice blue selection gradient (which I want to keep), and I have no idea how to draw it manually.
Change the button type to custom. There's a dropdown right below that for "Default", "Highlighted", "Selected", etc. Make a blue gradient, set it as the image for the "Highlighted State Configuration". That should give you the blue gradient when you highlight it. If you want it when it's selected, use the "Selected" configuration.
I've used a UISegmentedControl with only one segment for this. You can use tintColor you get a nice gradient. The event connections are slightly different but not a big deal.
This answer provides more detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With