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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:34:54+00:00 2026-05-15T14:34:54+00:00

I have created a UIScrollView (canvas.scrollview) and have a custom UIView (canvas) inside it.

  • 0

I have created a UIScrollView (canvas.scrollview) and have a custom UIView (canvas) inside it.

A normal configuration for starting up is something like this:

CGRect cs2 = CGRectMake(0, 0, 4000, 4000);
CGPoint screen = {[UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height};

self.canvas.frame = cs2; //canvas_size;

self.canvas.scrollView.contentSize = canvas_size.size;
self.canvas.scrollView.contentOffset = CGPointMake(canvas_size.size.width/2-screen.x/2,
canvas_size.size.height/2-screen.y/2);

But I have noticed that when I set the scrollview content size to a larger value such as 4000,4000; it will use a lot more memory. For example:

scrollview   view  real virtual
1000,1000 1000,1000 6  88
4000,4000 1000,1000 62  145
1000,1000 4000,4000 6  88

I would like to have a fairly large working area if possible, but 8000×8000 completely foobars the memory. Any idea why the scrollview would use up so much memory, and is there a way to fix this?

  • 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-05-15T14:34:54+00:00Added an answer on May 15, 2026 at 2:34 pm

    I use huge scroll views in my current project (thousands by thousands of pixels) and this is definitely not occuring for me. I think your UIView being enormous might be the problem, not your scroll view. Try setting the UIView‘s size to 768×1024 and then up the scroll view to 4k x 4k and see if the problem goes away.

    If the UIView happens to be an image (I doubt it, or you’d probably mention it), you should be aware that iOS only supports images up to 1024×1024 in size, after which there is a bit of “undefined behavior” in terms of memory usage. You probably need to look into CATiledLayer, though a plain UIView without content shouldn’t take up that much memory no matter how big it is, so there might be an issue elsewhere in your project as well.

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

Sidebar

Related Questions

My app looks like this: I have a UIScrollView and there is imageview inside.
I have a UIScrollView with multiple UIImageViews in it created like this. frame =
I have created a UIScrollView in my app - adapted from this sample code:
I have created a UIView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self)
I have created a UIView object using the contents of a NIB file like
Hope you can help. I have created my own Custom UIView and I'm trying
I have a UIScrollView which I create and size dynamically using... scrollView.contentSize = CGSizeMake(scrollView.frame.size.width
I have created a custom post type named People. I have created a page
I have a UIScrollView and a UIImageView which I have created programmatically without interface
I have created a scrolling/zooming image view by placing a UIImageView within a UIScrollView.

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.