RIP
Tutorial
Tags
Topics
Examples
eBooks
Tutorial by Examples
Set On / Off
Objective-C [mySwitch setOn:YES]; //or [mySwitch setOn:YES animated:YES]; Swift mySwitch.setOn(false) //or mySwitch.setOn(false, animated: false)
Set Background Color
Objective-C mySwitch.backgroundColor = [UIColor yellowColor]; [mySwitch setBackgroundColor: [UIColor yellowColor]]; mySwitch.backgroundColor =[UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1.0]; mySwitch.backgroundColor= [UIColor colorWithWhite: 0.5 alpha: 1.0]; mySwitch.backg...
Set Tint Color
Objective-C //for off-state mySwitch.tintColor = [UIColor blueColor]; [mySwitch setTintColor: [UIColor blueColor]]; //for on-state mySwitch.onTintColor = [UIColor cyanColor]; [mySwitch setOnTintColor: [UIColor cyanColor]]; Swift //for off-state mySwitch.tintColor = UIColor.blueColor() ...
Set Image for On/Off state
Objective-C //set off-image mySwitch.offImage = [UIImage imageNamed:@"off_image"]; [mySwitch setOffImage:[UIImage imageNamed:@"off_image"]]; //set on-image mySwitch.onImage = [UIImage imageNamed:@"on_image"]; [mySwitch setOnImage:[UIImage imageNamed:@"on_im...
Page 1 of 1
1
Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our
Cookie Policy
and
Privacy Policy
Accept all Cookies
Leave this website