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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:09:33+00:00 2026-06-03T16:09:33+00:00

I have a UIView subclass MyTextView that I add to a scrollView , and

  • 0

I have a UIView subclass MyTextView that I add to a scrollView, and it just has a bunch of text, but it gets to be really long sometimes (around 50,000 px high). Using regular drawing methods such as NSString's drawInRect method is apparently not the right way to do this, so now I’m looking into CATiledLayer to help me out with drawing the text. Unfortunately, there’s not enough examples out there to help with drawing text with CATiledLayer, and I’m wondering if anyone knows how I can get started with this task.

Is using CATiledLayer my best option when it comes to drawing really long text in a UIScrollView?

(I don’t want to use a UITextView since that’s also scrollable – and even if I were to use it, I wouldn’t want it to be scrollable, I’d set its frame to 50,000 px high, and that doesn’t solve my problem (remember that I’ll be adding this view to a scrollView, so a UITextView in a scrollView isn’t exactly fun)).

Any ideas?

  • 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-03T16:09:35+00:00Added an answer on June 3, 2026 at 4:09 pm

    I don’t know it CATiledLayer is the best but to get you started, you can draw the text content of each tile yourself.

    Create the layer and set the delegate:

       CATiledLayer *tiledLayer = [CATiledLayer layer];
        tiledLayer.delegate = self;
        tiledLayer.tileSize =  CGSizeMake(768, 1024);
        tiledLayer.levelsOfDetail = 4;
        tiledLayer.levelsOfDetailBias = 2;
    //etc.....
    

    Then just to normal CGContext drawing code:

    - (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
    

    you can get the tile rect and/or scale for drawing

    CGRect rect = CGContextGetClipBoundingBox(ctx);
    CGFloat scale = CGContextGetCTM(ctx).a;
    

    A word from the documentation on setting the layer delegate:

    In iOS, if the layer is associated with a UIView object, this property
    must be set to the view that owns the layer.

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

Sidebar

Related Questions

I want to have a UIView subclass that has a border image, but I
I have a UIView subclass ( CustomView for purposes of this question) that has
I have a UIView subclass that I assign to a text field as follows:
I have a UIView Subclass that has a frame/image with buttons in it. I'm
I have a UIView subclass that has the following in drawRect: for(int j=0; j<[myArray
I have a UIView subclass that draws itself when -drawRect: is called. It only
If I have a UIView (or UIView subclass) that is visible, how can I
Currently, I have a UIView subclass that stamps a single 2px by 2px CGLayerRef
So I have a Subclass of UIView that is suppose to detect touches. The
I have a UIView subclass that overrides UIResponder's touchesMoved: message. I've noticed that when

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.