4
votes

how to Change UIbutton background color?? I try it on IB, but it doesn't work. only changes it for custom button.

I would like to change the white color on the rounded rect button.

Or instead how to make a custom button whit rounded corners

thanks!

6

6 Answers

2
votes

You may find it difficult to adjust the default button. However you can use any view you want with a custom button.

Here's an article on creating views with rounded corners: http://iphonedevelopment.blogspot.com/2008/11/creating-transparent-uiviews-rounded.html

You also may look at a program called Opacity, which allows you to create a a lot of customized standard iOS interface art/buttons.

http://likethought.com/opacity/

18
votes

Rounded rect button's color can be changed to any color with the background color property in IB as well as through coding, but can not change its color to transparent color easily. For that, you better use a custom button with either rounded image or set layer as demonstrated in the example and don't forget to add Quartz Core framework in you project as well as to import it in your class.

UIBUtton *myBtn = [UIButton buttonWithType:UIbuttonTypeCustom];
myBtn.frame = frame;    //your desired size
myBtn.clipsToBounds = YES;
myBtn.layer.cornerRadius = 5.0f;
[self.view addSubView:myBtn];
1
votes
UIButton *tagButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];

and have a look at this... that my do the trick.. i did it for mine.

0
votes

You can use a custom UIButton with custom images for backgroundimage for each state. Just make the different states of your rounded button in photoshop for example.

0
votes

You can use Custom button But for that use the image of button of white rounded corners so it will be look like white round rectangle button

0
votes

You should use UIButtonTypeCustom, instead of any other.