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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:19:29+00:00 2026-05-23T08:19:29+00:00

I know there are many questions about this theme but I really read all

  • 0

I know there are many questions about this theme but I really read all of them but
not found an answer.

I want make a screenshot from the current table view. and i do it this way:

-(UIImage *)imageFromCurrentView
{
    UIGraphicsBeginImageContextWithOptions(self.tableView.bounds.size, YES, 1);
    [self.tableView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return img;
}

Everything works fine, but when i scroll down in the tableview and make the screenshot,
half of the image is black. I don’t know how to make the screenshot from the actual
tableview area.

  • 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-23T08:19:29+00:00Added an answer on May 23, 2026 at 8:19 am

    Because UITableViewCell is reusable, when scrolling the table view, the cells outside the view ports will be enqueued for reusing and removed from the table view. So try to keep the cells only be reusable on its index path:

    - (UITableViewCell *)tableView:(UITableView *)tableView
             cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
      NSString *cellIdentifier = [NSString stringWithFormat:@"Cell_%d_%d", indexPath.section, indexPath.row]; 
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
      if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithReuseIdentifier:cellIdentifier] autorelease];
      }
      ...
      return cell;
    }
    

    Not tested yet, give it a try. Yes, this will consume much more memory, do it with screenshot purpose only.

    Edit: if you care the memory usage, may be you can take screenshot of current view port, then programmatically scroll top and down to take other parts of screenshots, and combine all the screen shots at last.

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

Sidebar

Related Questions

I know there are already many questions like mine but I found no answer
NOTE: I know there are many questions that talked about that but I'm still
I know there are many threads that talk about this problem but I don't
First of all: I do know that there are already many questions and answers
I know that there are many Delphi database related questions available, but I'm considering
Yep there are many similar questions, but I really couldn't solve my problem. Unfortunately
I know that there are many free and not so free compression libraries out
I know there are hundreds of questions towards web development and many of these
I know there's tonnes of questions on python sorting lists/dictionaries already, but I can't
This is a bit of a crazy question, but does anyone out there know

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.