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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:39:58+00:00 2026-06-15T14:39:58+00:00

I am getting the images from the web services in list view but i

  • 0

I am getting the images from the web services in list view but i want to show them in grid
view. As i am displaying the images in list view,In grid view how i can do this ? please help.this is how my code looks:-

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    NSString *CELLIDENTIFIER=@"CELL";
    UITableViewCell *cell=nil;
    if (cell==nil) {

        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CELLIDENTIFIER] autorelease];
        CGRect imageFrame = CGRectMake(2, 8, 80, 60);
        NSURL *url = [NSURL URLWithString:[arrayListG objectAtIndex: [indexPath row]]];
        NSData *data = [NSData dataWithContentsOfURL:url];
        UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];
        UIImageView *customImage = [[[UIImageView alloc] initWithFrame:imageFrame] autorelease];

        customImage.image=img;
        [cell.contentView addSubview:customImage];
    }

    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-15T14:39:59+00:00Added an answer on June 15, 2026 at 2:39 pm
    Gridview = [[UIScrollView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];//your frame        
    Gridview.backgroundColor=[UIColor clearColor];
    int row=0;
    int column=0;
    int rows=4;
    int cols=5;
    for (int i=0; i<rows*cols; i++)
    {
        if((row%4==0)&&(row>0))
        {
            row=0;
            column++;
        } 
        else{
            row++; 
        }
    CGRect imageFrame = CGRectMake(row*80+10, column*60+10, 80, 60);//your imageview frame
        NSURL *url = [NSURL URLWithString:[arrayListG objectAtIndex:i]];
        NSData *data = [NSData dataWithContentsOfURL:url];
        UIImage *img = [[[UIImage alloc] initWithData:data] autorelease];
        UIImageView *customImage = [[[UIImageView alloc] initWithFrame:imageFrame] autorelease];
    
        customImage.image=img;
        [Gridview addSubView:customImage];
    
    }
    [Gridview setContentSize:CGSizeMake(rows*90, cols*70)];
    

    Gridview is your scrollview add it in IB or programatically as you desire in my case i have added it programatically. set content size and frame as per your requirement

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

Sidebar

Related Questions

Currently my application is getting data from remote server through web services. But some
I want to get images from a flickr rss but this code won't get
I want to get a thumbnail image for videos from Vimeo. When getting images
I was shown this rewrite for getting images to redirect to a particular web
I am trying to retrieve a list of images and text from a web
Hi i want to Bind GridView with images from the sd-card but not in
I have downloaded several images from the web but they are all too small
I am stuck with utf-8 to NSString. I am getting this data from web
I am having following code for getting image from the web: NSURL *ImageURL =
I am currently getting images from the 'Documents' directory (using -imageWithContentsOfFile:) with no problems

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.