views:

71

answers:

2

I can change UISwitch's color with below code but always color is yellow how to change color to another color?

UISwitch *switch1=[[UISwitch alloc]initWithFrame:CGRectMake(70, 121, 94, 27)];
[switch1 setAlternateColors:YES];
+1  A: 

From the UISwitch reference, "The UISwitch class is not customizable." So you can't change the appearance of UISwitch.

taskinoor
+1  A: 

Check this page for a project with a custom switch.

ibeitia