DrawRect Way to draw labels

Source: Internet
Author: User

If ([_info[@ "CashBack"] Floatvalue] > 0) {

Y + = 10.0;

// Check-out amount Description

            uilabel * Cashbacklabel = [triplabelfactory createlabelwithtext :[[nsstring stringwithformat :@ " return ¥%0.2f" ,[ _info[@ "CashBack" ] Floatvalue]/100.0 hotelpriceformat /span>

color:label_red

fontSize:ten

labelstyle:labelstylesolid];

cgsize labeltextsize = [Cashbacklabel. Text calculatesizewithfont: Cashbacklabel. Font];

            Text = [[nsstring stringwithformat:@ " check-in and return ¥%0.2f credit stay hotel red envelopes ",[_info< Span class= "S3" >[@ "CashBack" ] floatvalue]/< Span class= "S4" >100.0 hotelpriceformat;

            size = [text Calculatesizewithfont:text_font Constrainedtosize:cgsizemake ([uiscreen< Span class= "S3" > mainscreen]. Bounds. Size. Width-15.0-5.0- Cashbacklabel. width1000

if (!onlyheight) {

// Draw labels

[label_red set];

cgcontextref context5 = uigraphicsgetcurrentcontext(); // Set context

cgcontextsetlinewidth(CONTEXT5, 1.0);

Cgcontextsetrgbstrokecolor(CONTEXT5, 0.8, 0.1, 0.8, 1);

cgcontextfillrect(CONTEXT5, cgrectmake(x, y+ (size). Height-cashbacklabel. Height)/2.0, Cashbacklabel. Width, Cashbacklabel. Height));

// draw label copy

                [[uicolor whitecolor set];

                [Cashbacklabel. drawinrect:cgrectmake (x+ (Cashbacklabel. Width-labeltextsize. Width/2.0-cashbacklabel. Height/2.0 Width Height withfont:cashbacklabel. Font

[title_text_color set];

[Text drawinrect:cgrectmake(X+cashbacklabel. Width+5.0, y, size. Width, size. Height) withfont:text_font];

}

Y + = size. height;

}

DrawRect Way to draw labels

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.