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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:17:54+00:00 2026-05-27T00:17:54+00:00

I wondered if anyone knows how to get a shadaow effect like the one

  • 0

I wondered if anyone knows how to get a shadaow effect like the one in things as per the screenshot. To me it looks like the shadow effect is created by having a shadow at the bottom of the cell above and the top of the cell below.

I can create the one from the cell above using the code below but can’t figure out how to do it on the cell underneath as it doesn’t get shown it’s as if the cells are rendered in reverse order in terms of the z-index.

self.layer.shadowOffset = CGSizeMake(0, 2);
self.layer.shadowColor = [[UIColor blackColor] CGColor];
self.layer.shadowRadius = 2;
self.layer.shadowOpacity = 0.5;

CGFloat top = self.layer.bounds.origin.y;
CGFloat left = self.layer.bounds.origin.x;
CGFloat width = self.layer.bounds.size.width;

CGRect shadowFrame = CGRectMake(left, top, width, 44);
CGPathRef shadowPath = [UIBezierPath bezierPathWithRect:shadowFrame].CGPath;
self.layer.shadowPath = shadowPath;

Any suggestions much appreciated.

Things http://www.purplesmash.com/images/Things.jpg

  • 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-27T00:17:55+00:00Added an answer on May 27, 2026 at 12:17 am

    Just create hollow rectangle while drawing with CoreGraphics (align it exactly that hollow part cover your cell visible view) and set shadow for context – this will save performance for you.

    UPDATE:
    I’ve tried this inside my cell drawRect: method

    // Creating path which will hold our hollow rectangle
    CGMutablePathRef path = CGPathCreateMutable();
    CGPathAddRect(path, NULL, CGRectMake(-8.0f, -8.0f, 336.0f, 96.0f));
    CGPathAddRect(path, NULL, CGRectMake(-5.0f, 0.0f, 330.0f, 80.0f));
    
    // Saving current graphics context state
    CGContextSaveGState(context);
    
    // Configuring shadow
    CGContextSetShadowWithColor(context, CGSizeMake(0.0f, 0.0f), 6.0f, 
                                [[UIColor blackColor] CGColor]);
    
    // Adding our path
    CGContextAddPath(context, path);  
    
    // Configure hollow rectangle fill color
    CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0);
    
    // Fill rectangle and keep hollow part transparent
    CGContextEOFillPath(context);
    
    // Restore graphics context
    CGContextRestoreGState(context);
    

    Of course additional improvement will be pre-calculate CGMutablePathRef path somewhere in initialization or in this method by condition if(path == NULL). Colors can be retained too. If this should be last row of your cell update, than maybe you don’t event need to save context state.

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

Sidebar

Related Questions

Having Googled to no avail, I wondered if anyone knows of a list (similar
I'm developing a Django-based site for fun, and wondered if anyone knows how to
I'm having the following problem and wondered whether anyone could see why this is
I wondered if anyone knows if Microsoft is planning to do a Dynamic Data
I wondered if anyone has found a workaround to the behaviour that I'm experiencing.
I wondered if anyone could shed some light on the way in which layers
I want to trial Windows 7 but wondered if anyone who has done so
I'm learning about composite UIs at the moment and I wondered if anyone could
I'm thinking of writing a new web-based game, and wondered if anyone had any
I was curious if anyone knows a way (by using a setting or 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.