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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:51:22+00:00 2026-05-23T00:51:22+00:00

I am creating an app in which i want to display a table view

  • 0

I am creating an app in which i want to display a table view and each cell of table view will be displaying 5 different images.Let me say in detail.I have 10 images and i want to show them in a table view .say 4 images in first row of table view then next 4 in next row ,then the remaining two in next row.Being a newbie i am unable to get a startup.Please help.Any help will be appreciated.

Thanks,
Christy

  • 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-23T00:51:22+00:00Added an answer on May 23, 2026 at 12:51 am

    I think for startup you can go over here

    How to display the UITableView programmatically?

    Ok if you know how to load a uitableview than I think you can get started with complex part.

    You need to add this line of code in your cellForRow method

    You need to set the frame size and image name according to your requirement

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
        if(cell == nil)
        {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
                                          reuseIdentifier:cellIdentifier];
        }
        if(indexPath.row == 0)
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image1.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image2.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image3.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image4.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
        }
        else if(indexPath.row == 1)
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image5.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image6.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image7.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image8.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
        }
        else if(indexPath.row == 2)
        {
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image9.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];
    
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(14, 14, 15, 15)];
            imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"image10.png", ]];
            [cell.contentView addSubview:imageView];
            [imageView release];        
        }
        else
        {
            // Do something here
        }
        return cell;
    }
    

    Edit:

    @Christy you can have a button that can make a table view scroll. But iphone users are used to see the scroll bar on the right of the table to see if the table has any more data or not.

    But if you want to have a Button that scrolls the table than here is the code

    In your cellForRow method of tableView in this block else if(indexPath.row == 2){} add a UIButton with a down arrow like this

    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(220.0f, 5.0f, 150.0f, 38.0f)];
    [button setImage:[UIImage imageNamed:@"Arrow"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(doSomething) forControlEvents:UIControlEventTouchUpInside];
    [cell addSubview:button];
    [button release];
    

    and in the selector method

    - (void)doSomething
    {
        [tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:3 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES]
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an app in which i want to display a text box
I am creating a iPod app which will on multiple devices. For each user
I'm creating a Facebook app in which I want to display content depending on
I am creating an app which will have a question in a UILabel and
I am creating console app, involving lots of services. I want to display a
We are creating an ios app, In which we want to use certain interactive
I am creating an app which requires internet. I want to use reachability class
I am creating an app in which i have a UITableView and the table
I am creating a rails app which will help out businesses. These businesses have
I am creating a web app which uses jQuery to authenticate: $.ajax({ url: /session/create?format=json,

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.