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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:25:26+00:00 2026-05-22T20:25:26+00:00

When I am setting the tableView.separatorColor = [UIColor clearColor] its hides the section border

  • 0

When I am setting the

tableView.separatorColor = [UIColor clearColor]

its hides the section border too.
Any idea, how can I hide all cell separator border, but the rounded border of the whole section should be there.

I have tried this, it works somehow, but do not refresh, even I call [cell setNeedsDisplay]. If I scroll then the contents redrawn.

UIView *bgView = [[UIView alloc] initWithFrame: CGRectMake(cell.frame.origin.x +10, -1, 
                                                                   cell.frame.size.width - 20, 
                                                                   cell.frame.size.height + 1)];
        bgView.backgroundColor = [UIColor whiteColor];
        [cell addSubview: bgView];
        [cell sendSubviewToBack:bgView];
        cell.clipsToBounds = NO;
        [bgView release];
        [cell setNeedsDisplay];
  • 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-22T20:25:27+00:00Added an answer on May 22, 2026 at 8:25 pm

    Since I had only one cell, draw my variable number of cell as UILabel in one cell. That solve the problem for now!

    // Create a cell with dynamic number of elements looking like UITableViewCellStyleValue2
    - (UITableViewCell *) createDynamicCell {
        static NSString *CellIdentifier = @"Cell";
    
        UITableViewCell *cell;
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
                                       reuseIdentifier:CellIdentifier];
        cell.clipsToBounds = NO;
    
        // change frame of one or more labels
        CGRect cellFrame = self.tableView.frame;
        CGFloat startY = 5.0, startX = 10.0, extra1 = 20.0, gap = 10.0, startX2 = 0.0;
    
        UILabel *headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX + 5, startY, 300 - startX * 2, 44)];
        if (costBreakupStyle == CostBreakupDepartment) {
            headerLabel.text = NSLocalizedString(@"Cost per department:", @"");
        } else {
            headerLabel.text = NSLocalizedString(@"Amount spent per airline:", @"");
        }
        headerLabel.font = [UIFont boldSystemFontOfSize:17];
        [cell addSubview:headerLabel];
        [headerLabel release];
    
        startY = startY + 44 + 10;  
        float mid = (cellFrame.size.width - startX * 2 ) / 2;   
        startX2 = startX + extra1 + mid + gap;
    
        for (int i = 0; i < [dataSource count]; i++ ) {
            startY += 5; // cell gap
            NSString *text = [dataSource objectAtIndex:i];
            UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX, startY, 
                                                                           mid + extra1, kThinnerRowHeight)];
            textLabel.text = [NSString stringWithFormat:@"%@:", text];
    
            float cost = [(NSNumber *) [costArray objectAtIndex:i] floatValue];
            NSString *detailText = [NSString stringWithFormat:@"%@ %.2f", 
                                    [[Settings getInstance] getCurrencyCode], cost];
            UILabel *detailTextLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX2, startY, 
                                                                                 mid - extra1 - gap, kThinnerRowHeight)];       
            detailTextLabel.text = detailText;
    
            textLabel.font = [UIFont systemFontOfSize:15.0];
            textLabel.textAlignment = UITextAlignmentRight;
            detailTextLabel.font = [UIFont systemFontOfSize:15.0];
            detailTextLabel.textAlignment = UITextAlignmentLeft;
            detailTextLabel.textColor = [UIColor blueColor];
    
            [cell addSubview:textLabel];
            [cell addSubview:detailTextLabel];
            [textLabel release];
            [detailTextLabel release];
    
            startY += kThinnerRowHeight;
        }
    
        // Total amount label
        startY += 15; // add a gap  
        NSString *text = NSLocalizedString(@"Total amount spent:", @"");
        UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX, startY, 
                                                                       mid + 20, kThinnerRowHeight)];       
        textLabel.text = text;
    
        UILabel *detailTextLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX2, startY, 
                                                                             mid - extra1 - gap, kThinnerRowHeight)];
        detailTextLabel.text = [NSString stringWithFormat:@"%@ %.2f",
                                [[Settings getInstance] getCurrencyCode],
                                [[RequestResources getInstance] totalCredit]];
        textLabel.font = [UIFont systemFontOfSize:15.0];
        textLabel.textAlignment = UITextAlignmentRight;
        detailTextLabel.font = [UIFont systemFontOfSize:15.0];
        detailTextLabel.textAlignment = UITextAlignmentLeft;
        detailTextLabel.textColor = [UIColor blueColor];
        [cell addSubview:textLabel];
        [cell addSubview:detailTextLabel];
        [textLabel release];
        [detailTextLabel release];
    
        // Credit remaining label
        startY += kThinnerRowHeight;    
        text = NSLocalizedString(@"Total credit remaining:", @"");
        textLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX, startY, 
                                                              mid + 20, kThinnerRowHeight)];        
        textLabel.text = text;  
    
        detailTextLabel = [[UILabel alloc] initWithFrame:CGRectMake(startX2, startY, 
                                                                    mid - extra1 - gap, kThinnerRowHeight)];
        detailTextLabel.text = [NSString stringWithFormat:@"%@ %.2f",
                                [[Settings getInstance] getCurrencyCode],
                                [[RequestResources getInstance] remainingCredit]];
        textLabel.font = [UIFont systemFontOfSize:15.0];
        textLabel.textAlignment = UITextAlignmentRight;
        detailTextLabel.font = [UIFont systemFontOfSize:15.0];
        detailTextLabel.textAlignment = UITextAlignmentLeft;
        detailTextLabel.textColor = [UIColor blueColor];
        [cell addSubview:textLabel];
        [cell addSubview:detailTextLabel];
        [textLabel release];
        [detailTextLabel release];
    
        cellHeight = startY + kThinnerRowHeight + 10;   
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am setting the row height of my UITableView using following code [tableView setRowHeight:
I am setting my height: - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { CGFloat rowHeight =
I'm setting a UIImageView into my table cells during - (UITableViewCell *)tableView:(UITableView *)tableVw cellForRowAtIndexPath:(NSIndexPath
Can I have the number of rows dynamically? I'm trying to remove a tableView
I have a tableView storing a list of notifications (retrieved from server). How can
I'm setting the tableView cells height dynamically according to labels height and labels height
(This is about programatically swapping the style of existing tableview and not about setting
I can't get my first UITableView to update with a setting made in a
My tableview size is 500 by 500. I am creating a UITableViewCell and setting
I'm using custom headers for my tableview... - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { CustomHeaderController

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.