Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove UIButton selected background color?

I am looking for a solution to this problem that does NOT require using images/PNGs. I am looking for a way to remove the UIButton's blue background color when it's in selected state, and I just cannot find a way to do that without using images. I am basically trying to do something like that in case of a UITableViewCell:

   cell.selectionStyle = UITableViewCellSelectionStyleNone; 
like image 405
TommyG Avatar asked Jan 09 '12 15:01

TommyG


People also ask

How do I change the background color of a button in Swift?

Add a button on your storyboard, select it Go to it's attribute inspector and select 'Background' property to choose the color.


1 Answers

I had this same issue and I resolve it by changing the UIButton type from "System" to "Custom". The blue background color does not show up in selected state when it is a "Custom" type.

like image 140
Rufus Avatar answered Sep 21 '22 04:09

Rufus