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 8856339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:20:02+00:00 2026-06-14T14:20:02+00:00

I have used CATextLayer for Displaying bold and Normal text together.Now some time i

  • 0

I have used CATextLayer for Displaying bold and Normal text together.Now some time i am getting long text from the Web Service response so i am not able to display complete text.Can any one please help me what should be the way to make CATextLayer object Scrollable like textview.Please suggest me any solution regarding this.I have also take reference from Here but it’s not working for me. I am using this code:

/* Create the text layer on demand */

if (!_textLayer) {
    _textLayer = [[CATextLayer alloc] init];
    //_textLayer.font = [UIFont boldSystemFontOfSize:13].fontName; // not needed since `string` property will be an NSAttributedString
    _textLayer.backgroundColor = [UIColor clearColor].CGColor;
    _textLayer.wrapped = YES;
    //CALayer *layer = self.navigationController.toolbar.layer; //self is a view controller contained by a navigation controller
    _textLayer.frame = CGRectMake(5,325, 310, 90);
    _textLayer.contentsScale = [[UIScreen mainScreen] scale]; // looks nice in retina displays too :)
    _textLayer.alignmentMode = kCAAlignmentJustified;
    _textLayer.masksToBounds = YES;
    [self.view.layer addSublayer:_textLayer];
}

At bottom I have also tried to add my _textLayer to UITextView’s layer as well instead of self.view.layer.

Please suggest How could i achieve this feature?

  • 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-14T14:20:06+00:00Added an answer on June 14, 2026 at 2:20 pm

    You can just add your CATextLayer to UIScrollView and get scrolling for free.
    Set scrollview’s frame as needed and contentSize as your CATextLayer frame and add it to scroll’s layer, something like this (not actually working code):

    UIScrollView* scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0,100,100)];
    CATextLayer* layer = [CATextLayer layer];
    //layer init code goes here
    scroll.contentSize = CGSizeMake(1000,1000);//or your actual text layer size
    [scroll.layer addSublayer:layer];
    

    and you are done! Don’t forget to add scroll as your view subview.

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

Sidebar

Related Questions

I have used some jquery components in my web site, Suddenly i'm getting an
I have used 3 some jquery related files namely <script type=text/javascript src=/blog/jquery/jquery-1.7.1.min.js></script> <link type=text/css
I have used the jquery ajax for getting the values from the server.when the
I have used this website for testing http://www.webpagetest.org and among some suggestions for optimization
I have used several looking glass tools from servers around the world. What I'm
I have used this command to send xml files to a web service named
I have used Photoshop CS2's Save for Web feature to create a table of
I have used Countdown Timer like this new CountDownTimer(15000, 15) { public void onTick(long
I have used an expander control to create some sort of slide-out panel which
I have used the ddlgen tool to export the database schemas from my DEV

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.