IOS Uiswitch Usage Summary

Source: Internet
Author: User

Overview of the IOS system switch control simple use:

Initialization

-(Instancetype) initWithFrame: (CGRect) frame;

This frame is meaningless, and the size of the system's switch control is deterministic.

To set the color of the switch when the state is turned on

@property (nonatomic, retain) Uicolor *ontintcolor;

Set Switch style color

@property (nonatomic, retain) Uicolor *tintcolor;

Set the switch button color

@property (nonatomic, retain) Uicolor *thumbtintcolor;

Set the picture when the switch is on (note: no longer works after IOS7)

@property (nonatomic, retain) UIImage *onimage;

Set the picture when the switch is off (note: No longer works after IOS7)

@property (nonatomic, retain) UIImage *offimage;

Status of the switch

@property (Nonatomic,getter=ison) BOOL on;

Manually set the switch status

-(void) SetOn: (BOOL) on animated: (BOOL) animated;

A little bit of a feeling: The iOS system's Uiswitch control, although very poor in customization, with the IOS7 of the flat and frugal style, in beauty is really not inferior to any private custom switch control, in the absence of special needs, for switching logic, this is a very good UI interaction choice.

Learn to use welcome reprint

IOS Uiswitch Usage Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.