Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

rup28aug

macrumors newbie
Original poster
hi all,
i want to change the background color of button. There are no option to set the background color of button. also whether it is possible to make color as gradient ?
 
hi all,
i want to change the background color of button. There are no option to set the background color of button. also whether it is possible to make color as gradient ?
Correct, UIButton does not allow you to set the backgroundColor of the button. You can change the backgroundColor of it's UIView superclass but that's not what you want, since it changes the background color outside of the button. I would think your best bet is to use a background image for your button ( see setBackgroundImage:forState: ). This will also allow you to do the gradient you want.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.