IOS Development Note-uilable/uifont/uibutton Common settings

Source: Internet
Author: User

Common settings for Uilabel

@property (nonatomic,copy) NSString *text; Text to display

@property (Nonatomic,retain) Uifont *font; Font

@property (Nonatomic,retain) Uicolor *textcolor; Text color

@property (nonatomic) nstextalignment textalignment; Alignment modes (such as left, center, right)

Common settings for Uifont

+ (Uifont *) Systemfontofsize: (cgfloat) fontSize; system default Font

+ (Uifont *) Boldsystemfontofsize: (cgfloat) fontSize; Bold body

+ (Uifont *) Italicsystemfontofsize: (cgfloat) fontSize; Italic body

Common settings for UIButton

-(void) Settitle: (NSString *) title forstate: (uicontrolstate) state; Set the text of a button

-(void) Settitlecolor: (Uicolor *) color forstate: (uicontrolstate) state; Set the text color of a button

-(void) SetImage: (UIImage *) image forstate: (uicontrolstate) state; Set a small picture inside the button

-(void) SetBackgroundImage: (UIImage *) image forstate: (uicontrolstate) state; Set the background picture of the button

Btn.titleLabel.font = [Uifont systemfontofsize:13]; set the text font of the button (you need to get the label inside the button to set it)

-(NSString *) Titleforstate: (uicontrolstate) state; Get the text of the button

-(Uicolor *) Titlecolorforstate: (uicontrolstate) state; Get the text color of the button

-(UIImage *) Imageforstate: (uicontrolstate) state; Get the small picture inside the button

-(UIImage *) Backgroundimageforstate: (uicontrolstate) state; Get the background picture of the button

IOS Development Note-uilable/uifont/uibutton Common settings

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.