Enable custom UISwitch (continuous, clipsToBounds, userInt

Source: Internet
Author: User

The Code has several attributes that are not frequently used:

@ Property (nonatomic, getter = isContinuous) BOOL continuous; // if set, value change events are generated any time the value changes due to dragging. default = YES

This is an attribute in UISlider. It is used to send the sliderValueChanged method when you drag the track button, if it is set to no, it will not be sent when it is dragged.

If you want to send the sliderValueChanged method, use [self sendActionsForControlEvents: UIControlEventValueChanged];

@ Property (nonatomic) BOOL clipsToBounds;
// When YES, content and subviews are clipped to the bounds of the view. Default is NO.

This is an attribute in UIView. If the view exceeds the limit of the parent view, you can use this attribute to show the blocked part. If it is set to yes, the default value is no.

@ Property (nonatomic, getter = isUserInteractionEnabled) BOOL userInteractionEnabled;
// Default is YES. if set to NO, user events (touch, keys) are ignored and removed from the event queue.

This is an attribute in the UIView. For example, if there is a UIButton button in the window, and I add another UIView on it to cover the uibutton, The UIButton button will not receive a response, to make this button respond, set this attribute to no. The default value is yes.

 


 

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.