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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:21:36+00:00 2026-05-30T14:21:36+00:00

I have the following code that creates a gradient background for a UITableViewCell. The

  • 0

I have the following code that creates a gradient background for a UITableViewCell. The gradient came out great. However when I try selecting a row, I don’t see the regular blue highlighted row. If I remove the custom gradient code, the selected row highlights work fine. I am not sure what I am missing here. Any help is greatly appreciated.

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

static NSString *CellIdentifier = @"TimeTableViewCellList";

TimeTableViewCell *cell = (TimeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (!cell) {
    cell = [[[NSBundle mainBundle] loadNibNamed:@"TimeCell" owner:self options:nil] lastObject];
    //To create the cell gradient

    UIColor *startColor = [UIColor whiteColor];
    UIColor *endColor = [UIColor colorWithRed:247.0/255.0 green:243.0/255.0 blue:238.0/255.0 alpha:1.0];
    CAGradientLayer *gradient = [CAGradientLayer layer];
    gradient.frame = cell.bounds;
    gradient.colors = [NSArray arrayWithObjects:(id)[startColor CGColor], (id)[endColor CGColor], nil];
    [cell.layer insertSublayer:gradient atIndex:0];
}

TimeEntry * entry = [[self getTimeEntriesBySection:indexPath.section] objectAtIndex:indexPath.row];

//..OTHER CELL VALUES SET HERE   

cell.selectionStyle = UITableViewCellSelectionStyleBlue;


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-05-30T14:21:37+00:00Added an answer on May 30, 2026 at 2:21 pm

    Your gradient layer will be obscuring the selected effect.

    Try adding the gradient layer to cell.contentView.layer instead. If that doesn’t work, you may have to make the layer a property of your cell subclass and change its visibility in your override of setSelected:animated:

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

Sidebar

Related Questions

I have the following code that just creates a custom UITableViewCell. I am creating
I have the following code that creates two objects (ProfileManager and EmployerManager) where the
I have the following code that creates a serverside object of the xmlhttp class.
I have a method that contains the following (Java) code: doSomeThings(); doSomeOtherThings(); doSomeThings() creates
I have the following code, that in my head should create a new row
I have the following code that creates a draggable and droppable element/area. And when
I have created an application that creates notifications, using the following code: // notification
I have following code that creates Linq query. I've never used Linq until today
I have the following C# code that creates a DateTime , enters it into
So I have the following VB.NET code that creates a form field in a

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.