Common custom control development sets for iOS development Series-Custom radio buttons or multi-button control development

Source: Internet
Author: User

In our actual development we do login or registration function often need to tick a protocol this time need to use the checkbox button, checkbox is a PC or Android control iOS not, so we need to customize.
The Whc_radiobutton.h header files are as follows:

////  WHC_RadioButton.h//  CTBMobileBank////  Created by 吴海超 on 15/4/1.////#import <UIKit/UIKit.h>#define KWHC_IMAGE_SIZE (15.0)    //图标尺寸@interface WHC_RadioButton : UIButton@end

WHC_RADIOBUTTON.M source files are as follows:

////WHC_RADIOBUTTON.M//Ctbmobilebank////Created by Wuhaishu on 15/4/1.////#import "Whc_radiobutton.h"  @implementation Whc_radiobutton //Handle button title area- (CGRect) Titlerectforcontentrect: (CGRect) contentrect{Contentrect. Origin. x= Kwhc_image_size;returnContentrect;}//Processing icon Area- (CGRect) Imagerectforcontentrect: (CGRect) contentrect{CGRectrect = Cgrectzero; Rect. Origin. x=0.0; Rect. Origin. Y= (Cgrectgetheight ( Self. Bounds)-Kwhc_image_size)/2.0; Rect. Size. Height= Kwhc_image_size; Rect. Size. Width= Kwhc_image_size;returnRect;}@end

Common custom control development sets for iOS development Series-Custom radio buttons or multi-button control development

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.