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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:41:39+00:00 2026-05-16T14:41:39+00:00

– (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [topics count]; } – (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier

  • 0
-  (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        return [topics count];
    }

    - (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier {

        CGRect cellFrame = CGRectMake(0,0,320,45);  
        UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:cellIdentifier] autorelease];

        CGRect bgFrame = CGRectMake(10,5,300,35);   
        UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"list_bg_up.png"]];
        backgroundView.frame = bgFrame;
        [cell addSubview:backgroundView];

        UILabel *txtLabel = [[UILabel alloc] initWithFrame:CGRectMake(20,10,250,25)];
        txtLabel.textColor=[UIColor whiteColor];
        txtLabel.backgroundColor = [UIColor clearColor];
        txtLabel.tag = 1;
        [cell addSubview:txtLabel];

        return cell;
    }   

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

        UITableViewCell *cell;

        static NSString *kDisplayCell_ID = @"DisplayCellID";

        //cell = [self.tableView dequeueReusableCellWithIdentifier:kDisplayCell_ID];
        cell = [tableView dequeueReusableCellWithIdentifier:kDisplayCell_ID];

        if(cell == nil) {
            cell = [self getCellContentView:kDisplayCell_ID];
        }

        aTopic = [topics objectAtIndex:indexPath.row];
        UILabel *txtLabel = (UILabel *)[cell viewWithTag:1];
        txtLabel.text = aTopic.description;

        return cell;
    }

    -(CGFloat)tableView:(UITableView *)tbView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
        return 45;
    }

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        ResourcesViewController *resViewController = [[ResourcesViewController alloc] initWithNibName:@"ResourcesViewController" bundle:[NSBundle mainBundle]];
        resViewController.aTopic = [topics objectAtIndex:indexPath.row];
        [self.navigationController pushViewController:resViewController animated:YES];
        [resViewController release];
    }

if i want to change space between cells wat i hav to change in this code ….

now with this code i am able to display cells with some gap but i didnt understand how the gap defined…

  • 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-16T14:41:39+00:00Added an answer on May 16, 2026 at 2:41 pm

    If you’re talking about vertical height of the cells, change this code:

    -(CGFloat)tableView:(UITableView *)tbView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
            return 45;
        }
    

    If you’re talking about the horizontal space between data in the cell, you need to modify the CGRects here:

       CGRect cellFrame = CGRectMake(0,0,320,45);  
            UITableViewCell *cell = [[[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:cellIdentifier] autorelease];
    
            CGRect bgFrame = CGRectMake(10,5,300,35);   
            UIImageView *backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"list_bg_up.png"]];
            backgroundView.frame = bgFrame;
            [cell addSubview:backgroundView];
    
            UILabel *txtLabel = [[UILabel alloc] initWithFrame:CGRectMake(20,10,250,25)];
    

    Next time be a little more clear about what you’re asking. And don’t forget to accept answers to questions you ask. Cheers

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
So to start, I have an array of XML files. These files need to
I'm struggling to position the second level of a dropdown nav menu and was
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I'm trying to craft a Java regular expression to split strings of the general
Welcome to Spring Roo. For assistance press CTRL+SPACE or type hint then hit ENTER.
I am reading some og tags from sites but I can't seem to decode

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.