Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9158459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:15:04+00:00 2026-06-17T13:15:04+00:00

I want to make a NSString notification like this: You must pay 4.00 dollar..The

  • 0

I want to make a NSString notification like this: “You must pay 4.00 dollar.”.The money has a red color.In Android ,I can use HTML.formhtml do it.But I don’t know how to do it in IOS.Who can help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:15:05+00:00Added an answer on June 17, 2026 at 1:15 pm

    try this code

    CATextLayer *aTextLayer_= [[[CATextLayer alloc]init] autorelease];
        aTextLayer_.frame = CGRectMake(10, 100, 300, 50);
        aTextLayer_.backgroundColor=[UIColor clearColor].CGColor;
        aTextLayer_.foregroundColor = [[UIColor redColor] CGColor];
        aTextLayer_.alignmentMode=kCAAlignmentCenter;
        aTextLayer_.contentsScale = [[UIScreen mainScreen] scale];
        aTextLayer_ .wrapped=YES;
        [aTextLayer_ setAlignmentMode:kCAAlignmentLeft];
    
        UIFont *smallFont = [UIFont systemFontOfSize:25];
        CTFontRef ctSmallFont = CTFontCreateWithName((CFStringRef)smallFont.fontName, smallFont.pointSize, NULL);
    
        UIFont *boldFont = [UIFont systemFontOfSize:25];
        CTFontRef ctBoldFont = CTFontCreateWithName((CFStringRef)boldFont.fontName, boldFont.pointSize, NULL);
    
        CGColorRef cgColor = [UIColor greenColor].CGColor;
        CGColorRef cgColor1 = [UIColor redColor].CGColor;
    
        NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                    (id)ctSmallFont, (id)kCTFontAttributeName,
                                    cgColor, (id)kCTForegroundColorAttributeName, nil];
    
        NSDictionary *subattributes = [NSDictionary dictionaryWithObjectsAndKeys:
                                       (id)ctBoldFont, (id)kCTFontAttributeName,
                                       cgColor1, (id)kCTForegroundColorAttributeName, nil];
        CFRelease(ctBoldFont);
        NSString *subString=@"You must pay 4.00 dollar.";
        NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:subString attributes:attributes];
    
        [attrStr addAttributes:subattributes range:NSMakeRange(13,4)];
        aTextLayer_.string=attrStr;
        [self.view.layer addSublayer:aTextLayer_];
    

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make sql select sentence like this: NSLog(@sql = %@,[NSString stringWithFormat:@select *
I want to know how can I make an NSString accessible in the whole
I want make interactive application where user launches it and can do various task
I am new android app developer i want make app for tablets and phone
I want to make an sql statement - sqlStatement = [NSString stringWithFormat:@SELECT * FROM
I want to make the date to change one day every n seconds, like
I have this string (2.5+1)*5 I want to make a NSMutableArray containing each of
int score=8; scoreLabel.text=[NSString stringWithFormat:@%5d,score]; I want to make the scoreLabe show the text '00008',but
I want to make a UITableView act like an accordion. When a row is
I want to make a custom UITableViewCell programmatically. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.