Use of common IOS controls

Source: Internet
Author: User
Tags border color

UIButton

 //initialization   Position  uibutton *btn = [[uibutton alloc] initwithframe:cgrectmake ( SELF.VIEW.FRAME.SIZE.WIDTH-180, 45, 80, 30)];    [btn.layer  setcornerradius:5.0]; //Set Rectangle four fillet radius     [btn.layer setborderwidth:1.0]; // Border width     cgcolorspaceref colorspace = cgcolorspacecreatedevicergb ();     cgcolorref colorref = cgcolorcreate (ColorSpace, (CGFloat[]) { 0.9,  0.9, 0.9, 1 });     [btn.layer setbordercolor:colorref];//border color      [btn settitle: @ "button"  forState: UIControlStateNormal];     btn.titleLabel.font = [UIFont systemFontOfSize: 14.0];     [btn setbackgroundcolor: [uicolor bluecolor]];    [btn settitlecolor:[ Uicolor blackcolor]forstate:uIcontrolstatenormal];    [btn addtarget:self action: @selector (btnActioin:)   forcontrolevents:uicontroleventtouchupinside];    btn.tag = 1;     [btn setimage:[uiimage imagenamed:@ "Trade_choose_default"] forstate:uicontrolstatenormal] ;

Uicolor

[Uicolor colorwithred:0.95 green:0.93 blue:0.92 alpha:1];

UILabel

[Email protected] "Label"; label.hidden=yes;

UIImage

[UIImage imagenamed:@ "Trade_choose_default"]

UIView

    //Set Animation     CGContextRef context =  Uigraphicsgetcurrentcontext ();    [uiview beginanimations:nil context:context];     [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];     [uiview setanimationduration:0.6];//animation time length, units per second, floating point     //changing view location      [self.view exchangeSubviewAtIndex:0 withSubviewAtIndex:1];     Self.addresspicker.frame = cgrectmake (0, 380, 320, 180);     // Call when binding view events     [UIView setAnimationDelegate:self];    //  animations complete  animationfinished    [uiview setanimationdidstopselector: @selector ( animationfinished)];    //Start animation     [UIView commitAnimations];         // &nbs The view before it is placedp;  [self.view bringsubviewtofront:logisticspicker];         -(void) Animationfinished{    nslog (@ "End of animation!");}

Uitextfield

[TextField Setborderstyle:uitextborderstyleroundedrect]; Outer frame Type Textfield.placeholder = @ "password"; The default display of the word textfield.securetextentry = YES; Password


Use of common IOS controls

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.