iOS WordArt and simple picture-and-text blending

Source: Internet
Author: User

nsstring* Alerttext = [NSString stringWithFormat:@"the following%d courses (total paid ¥%.02lf) parents have not yet been taught and evaluated, please contact the parents as soon as possible, otherwise you will not be able to obtain the remuneration. ", Self.coursenum,self.totalprice]; Nsmutableattributedstring* Alertstring =[[Nsmutableattributedstring Alloc]initwithstring:alerttext]; Nsrange Totalrange= Nsmakerange (0, alertstring.length); [Alertstring addattributes:@{nsfontattributename:[uifont systemfontofsize:16.0],nsforegroundcolorattributename:[uicolor Themepinkcolor]} Range:totalrange];
Add an icon
to the front of the text nstextattachment
* Textattachment =[[Nstextattachment Alloc]initwithdata:nil Oftype:nil]; UIImage* Alerticon = [UIImage imagenamed:@"Lesson_icon26"]; Textattachment.image=Alerticon; Textattachment.bounds= CGRectMake (0,-5, Kalerticonheight, kalerticonheight); [alertstring insertattributedstring:[nsattributedstring attributedstringwithattachment:textattachment] AtIndex: 0]; Self.alertLabel.attributedText= alertstring;

iOS WordArt and simple picture-and-text blending

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.