iOS Tips 2

Source: Internet
Author: User

This code is implemented in a similar QQ zone"my space."the round head inside//a round headUiimageview * Headimage = [[Uiimageview alloc]initwithframe:cgrectmake ( -, -, -, -)]; Headimage.backgroundcolor=[Uicolor Graycolor]; Headimage.image= [UIImage imagenamed:@"headimage.jpg"]; Headimage.clipstobounds=YES; HeadImage.layer.cornerRadius= headimage.bounds.size.width/2; HeadImage.layer.borderWidth=2; HeadImage.layer.borderColor=[Uicolor Yellowcolor].    Cgcolor; [Self.view Addsubview:headimage];
*attribtdic = @{nsstrikethroughstyleattributename: [NSNumber Numberwithinteger:nsunderlinestylesingle]};         *ATTRIBTSTR = [[nsmutableattributedstring alloc]initwithstring:@ ' Price:+]= Attribtstr
When using target-action mode, there is a memory hint in ARC mode. Use these lines of code to eliminate hints. (Obsessive-Compulsive Gospel) #       pragma clang diagnostic       push#"-warc-performselector-leaks"              [_target performselector:_action withobject:self];#       pragma clang diagnostic pop
set the background color of the Uisearchbar today to Uisearchbar, before the online method has been unable to effectively remove its background color, modify the background color method as follows: Mysearchbar.backgroundcolor= Rgbacolor (249,249,249,1); Mysearchbar.backgroundimage=[self Imagewithcolor:[uicolor clearcolor] size:mySearchBar.bounds.size];//Cancel Searchbar background color-(UIImage *) Imagewithcolor: (Uicolor *) Color size: (cgsize) size{cgrect rect= CGRectMake (0,0, Size.width, size.height);    Uigraphicsbeginimagecontext (rect.size); Cgcontextref Context=Uigraphicsgetcurrentcontext ();    Cgcontextsetfillcolorwithcolor (context, [color Cgcolor]);        Cgcontextfillrect (context, rect); UIImage*image =Uigraphicsgetimagefromcurrentimagecontext ();        Uigraphicsendimagecontext (); returnimage;}
= Uirectedgenone;
// resolving cell reuse     while ([Cell.contentView.subviews lastobject]! = nil)        {*) [cell.contentView.subviews Lastobject] Removefromsuperview];    }

iOS Tips 2

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.