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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:19:59+00:00 2026-06-06T22:19:59+00:00

I want to display images in a TableView . I can display one image

  • 0

I want to display images in a TableView. I can display one image in one cell, but I want to display four images instead of one image in every row like a photo library and when I select any image, it will open as a slide show as it happened in the photo library.

My images are stored in Document Directory. How can I do this?

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tablView dequeueReusableCellWithIdentifier:CellIdentifier];
    if(cell == nil)
    {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    //Adjust your imageview frame according to you
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 0.0, 470.0, 80.0)];

    [imageView setImage:[arrayOfImages objectAtIndex:indexPath.row]];
    [cell.contentView addSubview:imageView];
    return cell;
}
  • 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-06T22:20:00+00:00Added an answer on June 6, 2026 at 10:20 pm

    Now I’m just explaining how to show an image like iPhone library. Use UIScrollView instead of UITableView. I think this will be better!

    After getting all images in an array, try this code:

    -(void)loadImagesOnScrollView
    {
        myScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0.0, 0.0, 320.0, 416.0)];
        myScrollView.delegate = self;
        myScrollView.contentSize = CGSizeMake(320.0, 416.0);
        myScrollView.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:myScrollView];
    
        float horizontal = 8.0;
        float vertical = 8.0;
    
        for(int i=0; i<[imageArray count]; i++)
        {
            if((i%4) == 0 && i!=0)
            {
                horizontal = 8.0;
                vertical = vertical + 70.0 + 8.0;
            }
    
            buttonImage = [UIButton buttonWithType:UIButtonTypeCustom];
            [buttonImage setFrame:CGRectMake(horizontal, vertical, 70.0, 70.0)];
            [buttonImage setTag:i];
            [buttonImage setImage:[imageArray objectAtIndex:i] forState:UIControlStateNormal];
            [buttonImage addTarget:self action:@selector(buttonImagePressed:) forControlEvents:UIControlEventTouchUpInside];
            [myScrollView addSubview:buttonImage];
    
            horizontal = horizontal + 70.0 + 8.0;
        }
    
        [myScrollView setContentSize:CGSizeMake(320.0, vertical + 78.0)];
    }
    

    And you can handle each image like this

    -(void)buttonImagePressed:(id)sender
    {
        NSLog(@"you have pressed : %d button",[sender tag]);
    }
    

    (Note: First of all, this is up to you and your logics so please make your logic strong. Nobody can write everything here. If you are a beginner then please do study for sometime “All The Very Best”)

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

Sidebar

Related Questions

I want to display images in WPF, but using an actual image, instead of
I want to display about 5-8 images on my page, one by one, but
i can display BG image in table view cell but when i click any
I want to display background image on tableview cell... on that i need to
Just looking for a good PHP Image Library, I want to display images with
I want to get the Bitmap from URL like - https://graph.facebook.com/100003506521332/picture I tried how-i-can-display-images-from-url-in-blackberry
I want display images in gallery view it want to focus to paticular image
I want to show a custom checkmark and uncheckmark image for tableview cell when
I want to increase the size of cell image which I have set like
I want to display images in my application. But in emulator there no any

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.