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

  • Home
  • SEARCH
  • 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 7038205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:38:28+00:00 2026-05-28T01:38:28+00:00

After use UITableView Style Grouped, it have a problem when use selectedBackgroundView with custom

  • 0

enter image description here
After use UITableView Style Grouped, it have a problem when use selectedBackgroundView with custom color.

it draw outside of there UITableViewCell.
Is it possible to clip them in bound ?

  • 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-28T01:38:28+00:00Added an answer on May 28, 2026 at 1:38 am

    I had similar problems and didn’t find any simple and easy method to solve. I maked category for UIImage and used several images for catch all cases.

    • single_cell_bg.png – image with all rounded corners
    • top_cell_bg – image with rounded top corners
    • …..

    not so elegant but working

    @interface UIImage (CellBacground)
    - (UIImage *)backgroundCellViewforRow:(NSInteger)row totalRow:(NSInteger)total;
    @end
    
    
    
    #import "UIImage+CellBacground.h"
    
    @implementation UIImage (CellBacground)
    
    - (UIImage *)backgroundCellViewforRow:(NSInteger)row totalRow:(NSInteger)total {
        NSString *path = NULL;
        if (row == 0) {
            if(total == 1) {
                path = [[NSBundle mainBundle] pathForResource:@"single_cell_bg" ofType:@"png"];
            } else {
                path = [[NSBundle mainBundle] pathForResource:@"top_cell_bg" ofType:@"png"];
            }
        } else {
            if ((total - row) == 1) {
                path = [[NSBundle mainBundle] pathForResource:@"bottom_cell_bg" ofType:@"png"];
            } else {
                path = [[NSBundle mainBundle] pathForResource:@"middle_cell_bg" ofType:@"png"];
            }
        }
        UIImage *theImage = [[UIImage alloc] initWithContentsOfFile:path];
        UIEdgeInsets imInset = UIEdgeInsetsMake(10, 10, 10, 10);
        UIImage *strImage = [theImage resizableImageWithCapInsets:imInset];
        return strImage;
    }
    @end
    

    Call in tableView:cellForRowAtIndexPath:

    UIImage *backImage = [[UIImage alloc] init];
    [backImage backgroundCellViewforRow:indexPath.row totalRow:[tableView numberOfRowsInSection:indexPath.section]];
    UIImageView *backview = [[UIImageView alloc] initWithImage:backImage];
    cell.selectedBackgroundView = backview;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use NSFetchedResultController and CoreData to manage my UITableView, but I have a problem.
It seems to be possible in this project ... After they use pd =
So I have a UITableView which should loop through a single NSMutableArray and use
I have a UITableView with about 20 rows. I also use check mark accessory
I have a UITableView which I use to display images in a grid form.
I have a bunch of userdefaults value that I use to load my UITableView
I have a custom UITableViewCell with a UIScrollView in it that is wired to
I am trying to use custom UITableViewCells defined in IB where there are referencing
I have a UITableView with reorderable rows and I'm using the standard UITableViewCell.text property
After some use Visual Studio 2008 when opening a solution that is checked into

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.