Common custom control development sets for iOS development series-Custom multi-select button control development

Source: Internet
Author: User
Tags uikit

In the actual development of many times we need to use the drop-down list, we have to implement below.
The whc_combobox.h header files are as follows:

////  WHC_ComboBox.h//  WHC_ComboBox////  Created by 吴海超 on 15/4/2.////#import <UIKit/UIKit.h>@interface WHC_ComboBox : UIButton@end

WHC_COMBOBOX.M source files are as follows:

////WHC_COMBOBOX.M//Whc_combobox////Created by Wuhaishu on 15/4/2.////#import "whc_combobox.h" #define KWHC_PADING (5.0)//Picture margin @implementation whc_combobox //Load Xib- (void) awakefromnib{ Self. Layer. BorderColor= [UicolorBlackcolor]. Cgcolor; Self. Layer. BorderWidth=0.5;}//Processing header area- (CGRect) Titlerectforcontentrect: (CGRect) contentrect{Contentrect. Origin. x=1.0;returnContentrect;}//Processing icon Area- (CGRect) Imagerectforcontentrect: (CGRect) contentrect{CGRectrc = Cgrectzero;CGFloatwidth = cgrectgetheight (contentrect)-2.0* kwhc_pading; Rc. Origin. x= Cgrectgetwidth (contentrect)-width-kwhc_pading; Rc. Origin. Y= kwhc_pading; Rc. Size. Width= width; Rc. Size. Height= width;returnRC;}@end

Common custom control development sets for iOS development series-Custom multi-select button control development

Related Article

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.