Donate Bitcoin
If you're usingSevenSwitch
in an app or for some other reason consider throwing me some coin.1GuFb1y7xEmKiD6XD3tGEJBriYJ2hXp8zY
Usage
To use it, add SevenSwitch.h and SevenSwitch.m files to your project and add the QuartzCore framework to your project.Initializing and adding the switch to the screen
SevenSwitch *mySwitch = [[SevenSwitch alloc] initWithFrame:CGRectMake(10, 10, 50, 30)];
[self.view addSubview:mySwitch];
UIControlEventValueChanged
event is generated.[mySwitch addTarget:self action:@selector(switchChanged:) forControlEvents:UIControlEventValueChanged];
mySwitch.offImage = [UIImage imageNamed:@"cross.png"];
mySwitch.onImage = [UIImage imageNamed:@"check.png"];
mySwitch.thumbTintColor = [UIColor colorWithRed:0.19f green:0.23f blue:0.33f alpha:1.00f];
mySwitch.activeColor = [UIColor colorWithRed:0.07f green:0.09f blue:0.11f alpha:1.00f];
mySwitch.inactiveColor = [UIColor colorWithRed:0.07f green:0.09f blue:0.11f alpha:1.00f];
mySwitch.onTintColor = [UIColor colorWithRed:0.45f green:0.58f blue:0.67f alpha:1.00f];
mySwitch.borderColor = [UIColor clearColor];
mySwitch.shadowColor = [UIColor blackColor];
mySwitch.frame = CGRectMake(0, 0, 100, 50);
isRounded
property to NO
mySwitch.isRounded = NO;
Requirements
SevenSwitch requires iOS 5.0 and above.Download: https://github.com/bvogelzang/SevenSwitch/archive/master.zip
No comments:
Post a Comment